Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2017 03:21:42 +0000 (UTC)
From:      Peter Grehan <grehan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315364 - head/sys/amd64/vmm
Message-ID:  <201703160321.v2G3Lgkb003067@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703160321.v2G3Lgkb003067>