Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix FPU DNA exception on NetBSD #168
Thanks for fixing the issue! IIUC, the NetBSD guest runs into #NM because guest CR0.TS is set, and in this PR you are making sure host CR0.TS is clear right before every VM entry.
So my question is: what's the relationship between host CR0.TS and guest CR0.TS? Why does clearing the former result in the latter being cleared?
Note that there is a
So have you looked into how HAXM updates the TS bit (bit 3) of
According to my understanding the NetBSD kernel runs with CR0_TS set and we must explicitly disable this bit before any FPU operation in order to prevent FPU DNA. This is done in other parts of the NetBSD kernel whenever we do anything with FPU.
A similar magic is done in NVMM:
BTW, just to answer my own question:
The two are completely separate. At least on my Haswell host, VMX allows the guest full control over CR0.TS, so this bit is mapped to bit 3 of