Hi Paul,
On 05/10/2020 10:49, Paul Durrant wrote:
From: Paul Durrant <pdurr...@amazon.com>
Set these flags prior to the calls to arch_iommu_domain_init() and the
implementation init() method. There is no reason to hide this information from
those functions and the value of 'hap_pt_share' will be needed by a
modification to arch_iommu_domain_init() made in a subsequent patch.
Signed-off-by: Paul Durrant <pdurr...@amazon.com>
Reviewed-by: Julien Grall <jgr...@amazon.com>
Cheers,
---
Cc: Jan Beulich <jbeul...@suse.com>
---
xen/drivers/passthrough/iommu.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 642d5c8331..fd9705b3a9 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -174,15 +174,6 @@ int iommu_domain_init(struct domain *d, unsigned int opts)
hd->node = NUMA_NO_NODE;
#endif
- ret = arch_iommu_domain_init(d);
- if ( ret )
- return ret;
-
- hd->platform_ops = iommu_get_ops();
- ret = hd->platform_ops->init(d);
- if ( ret || is_system_domain(d) )
- return ret;
-
/*
* Use shared page tables for HAP and IOMMU if the global option
* is enabled (from which we can infer the h/w is capable) and
@@ -202,7 +193,12 @@ int iommu_domain_init(struct domain *d, unsigned int opts)
ASSERT(!(hd->need_sync && hd->hap_pt_share));
- return 0;
+ ret = arch_iommu_domain_init(d);
+ if ( ret )
+ return ret;
+
+ hd->platform_ops = iommu_get_ops();
+ return hd->platform_ops->init(d);
}
void __hwdom_init iommu_hwdom_init(struct domain *d)
--
Julien Grall