WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] vtd: check and print EPT compatibility once, at boot

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] vtd: check and print EPT compatibility once, at boot
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Wed, 20 Apr 2011 12:01:11 +0100
Cc: Allen Kay <allen.m.kay@xxxxxxxxx>
Delivery-date: Wed, 20 Apr 2011 04:04:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1303297202 -3600
# Node ID 4e35d6213ab8a02c2639ffc94920f96fe3668784
# Parent  3539ef956a378ad7fe39654ff9aca5b0e7bf8843
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@xxxxxxxxxx>

diff -r 3539ef956a37 -r 4e35d6213ab8 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Mon Apr 18 18:34:45 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Wed Apr 20 12:00:02 2011 +0100
@@ -1737,28 +1737,6 @@ static int vtd_ept_page_compatible(struc
     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 ( !iommu_hap_pt_share )
-        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
  */
@@ -1769,17 +1747,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,
@@ -2080,6 +2052,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;
+
         ret = iommu_set_interrupt(iommu);
         if ( ret < 0 )
         {
@@ -2101,6 +2076,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();

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] vtd: check and print EPT compatibility once, at boot, Tim Deegan <=