summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-08-20 06:46:40 +0000
committerneel <neel@FreeBSD.org>2013-08-20 06:46:40 +0000
commit44099f40929de233e7b720595a5a90f410ec7bcd (patch)
tree7de6916c1f17f1ce1c42884c3ba2276a769720fc /sys/amd64
parent15659a9ddf36ff14d1f8eb8329675e1f1251301d (diff)
downloadFreeBSD-src-44099f40929de233e7b720595a5a90f410ec7bcd.zip
FreeBSD-src-44099f40929de233e7b720595a5a90f410ec7bcd.tar.gz
Do not create superpage mappings in the iommu.
This is a workaround to hide the fact that we do not have any code to demote a superpage mapping before we unmap a single page that is part of the superpage.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/vmm/intel/vtd.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c
index a8ed265..3d7b495 100644
--- a/sys/amd64/vmm/intel/vtd.c
+++ b/sys/amd64/vmm/intel/vtd.c
@@ -611,13 +611,30 @@ vtd_create_domain(vm_paddr_t maxaddr)
dom = malloc(sizeof(struct domain), M_VTD, M_ZERO | M_WAITOK);
dom->pt_levels = pt_levels;
dom->addrwidth = addrwidth;
- dom->spsmask = VTD_CAP_SPS(vtdmap->cap);
dom->id = domain_id();
dom->maxaddr = maxaddr;
dom->ptp = malloc(PAGE_SIZE, M_VTD, M_ZERO | M_WAITOK);
if ((uintptr_t)dom->ptp & PAGE_MASK)
panic("vtd_create_domain: ptp (%p) not page aligned", dom->ptp);
+#ifdef notyet
+ /*
+ * XXX superpage mappings for the iommu do not work correctly.
+ *
+ * By default all physical memory is mapped into the host_domain.
+ * When a VM is allocated wired memory the pages belonging to it
+ * are removed from the host_domain and added to the vm's domain.
+ *
+ * If the page being removed was mapped using a superpage mapping
+ * in the host_domain then we need to demote the mapping before
+ * removing the page.
+ *
+ * There is not any code to deal with the demotion at the moment
+ * so we disable superpage mappings altogether.
+ */
+ dom->spsmask = VTD_CAP_SPS(vtdmap->cap);
+#endif
+
SLIST_INSERT_HEAD(&domhead, dom, next);
return (dom);
OpenPOWER on IntegriCloud