Author: grehan
Date: Thu Mar 16 03:21:42 2017
New Revision: 315364
URL: https://svnweb.freebsd.org/changeset/base/315364

Log:
  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

Modified:
  head/sys/amd64/vmm/x86.c

Modified: head/sys/amd64/vmm/x86.c
==============================================================================
--- head/sys/amd64/vmm/x86.c    Thu Mar 16 03:20:59 2017        (r315363)
+++ head/sys/amd64/vmm/x86.c    Thu Mar 16 03:21:42 2017        (r315364)
@@ -176,6 +176,9 @@ x86_emulate_cpuid(struct vm *vm, int vcp
                        /* 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.
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to