Skip to content

Commit

Permalink
BHYVE: OS-6937 support large page mapping for bhyve IOMMU domains
Browse files Browse the repository at this point in the history
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: John Levon <john.levon@joyent.com>
  • Loading branch information
hrosenfeld authored and citrus-it committed Jun 8, 2018
1 parent 7990bd3 commit 8ebb004
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions usr/src/uts/i86pc/io/vmm/intel/vtd.c
Expand Up @@ -705,6 +705,7 @@ vtd_create_domain(vm_paddr_t maxaddr)
if ((uintptr_t)dom->ptp & PAGE_MASK)
panic("vtd_create_domain: ptp (%p) not page aligned", dom->ptp);

#ifdef __FreeBSD__
#ifdef notyet
/*
* XXX superpage mappings for the iommu do not work correctly.
Expand All @@ -722,6 +723,18 @@ vtd_create_domain(vm_paddr_t maxaddr)
*/
dom->spsmask = VTD_CAP_SPS(vtdmap->cap);
#endif
#else
/*
* On illumos we decidedly do not remove memory mapped to a VM's domain
* from the host_domain, so we don't have to deal with page demotion and
* can just use large pages.
*
* Since VM memory is currently allocated as 4k pages and mapped into
* the VM domain page by page, the use of large pages is essentially
* limited to the host_domain.
*/
dom->spsmask = VTD_CAP_SPS(vtdmap->cap);
#endif

SLIST_INSERT_HEAD(&domhead, dom, next);

Expand Down

0 comments on commit 8ebb004

Please sign in to comment.