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).

Reviewed by:	kib
MFC after:	1 week
This commit is contained in:
Peter Grehan 2017-03-16 03:21:42 +00:00
parent 494deaf862
commit 3da443021f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315364

View File

@ -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.