diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-04-25 13:38:51 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-04-25 13:38:51 +0100 |
commit | 12587a3a895685a094be2bbd291c286944f139d6 (patch) | |
tree | 3000826dbfa41acbc30f107ac8e8a3975460bcd7 | |
parent | a619245a1e226abe8a1d334663fa233118094c19 (diff) | |
download | xen-12587a3a895685a094be2bbd291c286944f139d6.tar.gz xen-12587a3a895685a094be2bbd291c286944f139d6.tar.bz2 xen-12587a3a895685a094be2bbd291c286944f139d6.zip |
vtd: check and print EPT compatibility once, at boot.
Merge the check for EPT/VT-D pagetable compatibility into the other
VT-D boot-time checks. Previously it was checking and printing many
times on each VM boot.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 23247:80401982465d
xen-unstable date: Mon Apr 25 13:17:05 2011 +0100
-rw-r--r-- | xen/drivers/passthrough/vtd/iommu.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index b69d5e3cc0..abcf022454 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1740,28 +1740,6 @@ static int vtd_ept_page_compatible(struct iommu *iommu) return 1; } -static bool_t vtd_ept_share(void) -{ - struct acpi_drhd_unit *drhd; - struct iommu *iommu; - bool_t share = TRUE; - - /* sharept defaults to 0 for now, default to 1 when feature matures */ - if ( !sharept ) - share = FALSE; - - /* - * Determine whether EPT and VT-d page tables can be shared or not. - */ - for_each_drhd_unit ( drhd ) - { - iommu = drhd->iommu; - if ( !vtd_ept_page_compatible(drhd->iommu) ) - share = FALSE; - } - return share; -} - /* * set VT-d page table directory to EPT table if allowed */ @@ -1772,17 +1750,11 @@ void iommu_set_pgd(struct domain *d) ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); - iommu_hap_pt_share = vtd_ept_share(); if ( !iommu_hap_pt_share ) - goto out; + return; pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); hd->pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn)); - -out: - dprintk(XENLOG_INFO VTDPREFIX, - "VT-d page table %s with EPT table\n", - iommu_hap_pt_share ? "shares" : "not sharing"); } static int domain_rmrr_mapped(struct domain *d, @@ -2092,6 +2064,9 @@ int __init intel_vtd_setup(void) if ( iommu_intremap && !ecap_intr_remap(iommu->ecap) ) iommu_intremap = 0; + + if ( !vtd_ept_page_compatible(iommu) ) + iommu_hap_pt_share = FALSE; } if ( !iommu_qinval && iommu_intremap ) @@ -2106,6 +2081,7 @@ int __init intel_vtd_setup(void) P(iommu_passthrough, "Dom0 DMA Passthrough"); P(iommu_qinval, "Queued Invalidation"); P(iommu_intremap, "Interrupt Remapping"); + P(iommu_hap_pt_share, "Shared EPT tables"); #undef P scan_pci_devices(); |