diff options
author | grehan <grehan@FreeBSD.org> | 2013-07-01 20:05:43 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2013-07-01 20:05:43 +0000 |
commit | cba9c47f36f317e465c63692c251172caa251136 (patch) | |
tree | 336546bc495e1f4bffa228329e33190e1eb402d7 /sys/amd64 | |
parent | 9be28143e483f1a1e68d230131476f697afb2ab8 (diff) | |
download | FreeBSD-src-cba9c47f36f317e465c63692c251172caa251136.zip FreeBSD-src-cba9c47f36f317e465c63692c251172caa251136.tar.gz |
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
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/vmm/intel/ept.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/amd64/vmm/intel/ept.c b/sys/amd64/vmm/intel/ept.c index 4f91601..1ff1580 100644 --- a/sys/amd64/vmm/intel/ept.c +++ b/sys/amd64/vmm/intel/ept.c @@ -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_paddr_t gpa, vm_paddr_t hpa, size_t length, 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; |