[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] IOMMU: page table dumping adjustments



commit fd7e0b14a82b36bfb7941150f1cc84e682780525
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Sep 16 10:56:25 2021 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Sep 16 10:56:25 2021 +0200

    IOMMU: page table dumping adjustments
    
    For one none of the three IOMMU implementations on Arm specify a dumping
    hook. Generalize VT-d's "don't dump shared page tables" to cover for
    this.
    
    Further in the past I was told that on Arm in principle there could be
    multiple different IOMMUs, and hence different domains' platform_ops
    pointers could differ. Use each domain's ops for calling the dump hook.
    (In the long run all uses of iommu_get_ops() would likely need to
    disappear for this reason.)
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/drivers/passthrough/iommu.c     | 11 +++++++----
 xen/drivers/passthrough/vtd/iommu.c |  6 ------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index fd2578d30a..6334370109 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -587,12 +587,9 @@ bool_t iommu_has_feature(struct domain *d, enum 
iommu_feature feature)
 static void iommu_dump_page_tables(unsigned char key)
 {
     struct domain *d;
-    const struct iommu_ops *ops;
 
     ASSERT(iommu_enabled);
 
-    ops = iommu_get_ops();
-
     rcu_read_lock(&domlist_read_lock);
 
     for_each_domain(d)
@@ -600,7 +597,13 @@ static void iommu_dump_page_tables(unsigned char key)
         if ( is_hardware_domain(d) || !is_iommu_enabled(d) )
             continue;
 
-        ops->dump_page_tables(d);
+        if ( iommu_use_hap_pt(d) )
+        {
+            printk("%pd sharing page tables\n", d);
+            continue;
+        }
+
+        dom_iommu(d)->platform_ops->dump_page_tables(d);
     }
 
     rcu_read_unlock(&domlist_read_lock);
diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index 2034a95a87..08890c66d4 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2668,12 +2668,6 @@ static void vtd_dump_page_tables(struct domain *d)
 {
     const struct domain_iommu *hd = dom_iommu(d);
 
-    if ( iommu_use_hap_pt(d) )
-    {
-        printk(VTDPREFIX " %pd sharing EPT table\n", d);
-        return;
-    }
-
     printk(VTDPREFIX" %pd table has %d levels\n", d,
            agaw_to_level(hd->arch.vtd.agaw));
     vtd_dump_page_table_level(hd->arch.vtd.pgd_maddr,
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.