]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL
authorCorvin Köhne <C.Koehne@beckhoff.com>
Thu, 15 Apr 2021 03:49:19 +0000 (13:49 +1000)
committerPeter Grehan <grehan@FreeBSD.org>
Thu, 15 Apr 2021 03:49:19 +0000 (13:49 +1000)
commit17d214c2ca9f110db3fa2a10d6b448d624e87774
treefd1f5e8b6b8b4c9f6c55c0e6bf5da3ecea410a2f
parent14d0cd7225e250015eb6d9c79a7eb4e944211b23
bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL

Without the -w option, Windows guests crash on boot. This is caused by a rdmsr
of MSR_IA32_FEATURE_CONTROL. Windows checks this MSR to determine enabled VMX
features. This MSR isn't emulated in bhyve, so a #GP exception is injected
which causes Windows to crash.

Fix by returning a rdmsr of MSR_IA32_FEATURE_CONTROL with Lock Bit set and
VMX disabled to informWindows that VMX isn't available.

Reviewed by: jhb, grehan (bhyve)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29665
usr.sbin/bhyve/xmsr.c