Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 2013 20:05:43 +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: r252475 - head/sys/amd64/vmm/intel
Message-ID:  <201307012005.r61K5hAs037808@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: grehan
Date: Mon Jul  1 20:05:43 2013
New Revision: 252475
URL: http://svnweb.freebsd.org/changeset/base/252475

Log:
  Ignore guest PAT settings by default in EPT mappings.
  From experimentation, other hypervisors also do this.
  
  Diagnosed by:	tycho nightingale at pluribusnetworks com
  Reviewed by:	neel

Modified:
  head/sys/amd64/vmm/intel/ept.c

Modified: head/sys/amd64/vmm/intel/ept.c
==============================================================================
--- head/sys/amd64/vmm/intel/ept.c	Mon Jul  1 19:58:13 2013	(r252474)
+++ head/sys/amd64/vmm/intel/ept.c	Mon Jul  1 20:05:43 2013	(r252475)
@@ -77,6 +77,11 @@ MALLOC_DECLARE(M_VMX);
 
 static uint64_t page_sizes_mask;
 
+/*
+ * Set this to 1 to have the EPT tables respect the guest PAT settings
+ */
+static int ept_pat_passthru;
+
 int
 ept_init(void)
 {
@@ -226,10 +231,13 @@ ept_create_mapping(uint64_t *ptp, vm_pad
 			ptp[ptpindex] |= EPT_PG_EX;
 
 		/*
-		 * XXX should we enforce this memory type by setting the
-		 * ignore PAT bit to 1.
+		 * By default the PAT type is ignored - this appears to
+		 * be how other hypervisors handle EPT. Allow this to be
+		 * overridden.
 		 */
 		ptp[ptpindex] |= EPT_PG_MEMORY_TYPE(attr);
+		if (!ept_pat_passthru)
+			ptp[ptpindex] |= EPT_PG_IGNORE_PAT;
 
 		if (nlevels > 0)
 			ptp[ptpindex] |= EPT_PG_SUPERPAGE;



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