diff options
author | grehan <grehan@FreeBSD.org> | 2017-03-25 05:05:12 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2017-03-25 05:05:12 +0000 |
commit | bfdf1ebc2056f733f1fc31600892287fae8e4d54 (patch) | |
tree | 1caf070a52b73373344f6f8e33ad4438cde75d24 /sys/amd64/vmm/x86.c | |
parent | 417388477be7dae7a2b7b03337e9e8beb5b0f8b8 (diff) | |
download | FreeBSD-src-bfdf1ebc2056f733f1fc31600892287fae8e4d54.zip FreeBSD-src-bfdf1ebc2056f733f1fc31600892287fae8e4d54.tar.gz |
MFC r315361 and r315364: Hide MONITORX/MWAITX from guests.
r315361
Add the AMD MONITORX/MWAITX feature definition introduced in
Bulldozer/Ryzen CPUs.
r315364
Hide the AMD MONITORX/MWAITX capability.
Otherwise, recent Linux guests will use these instructions, resulting
in #UD exceptions since bhyve doesn't implement MONITOR/MWAIT exits.
This fixes boot-time hangs in recent Linux guests on Ryzen CPUs
(and probably Bulldozer aka AMD FX as well).
Diffstat (limited to 'sys/amd64/vmm/x86.c')
-rw-r--r-- | sys/amd64/vmm/x86.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index 525e1d9..61d99d5 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -176,6 +176,9 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, /* Don't advertise the OS visible workaround feature */ regs[2] &= ~AMDID2_OSVW; + /* Hide mwaitx/monitorx capability from the guest */ + regs[2] &= ~AMDID2_MWAITX; + /* * Hide rdtscp/ia32_tsc_aux until we know how * to deal with them. |