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

Re: [Xen-devel] [PATCH 5/6] iommu: tidy up iommu_us_hap_pt() and need_iommu_pt_sync() macros

On 30.07.2019 15:44, Paul Durrant wrote:
Thes macros really ought to live in the common xen/iommu.h header rather
then being distributed amongst architecture specific iommu headers and
xen/sched.h. This patch moves them there.

NOTE: Disabling 'sharept' in the command line iommu options should really
       be hard error on ARM (as opposed to just being ignored), so avoid
       parsing that option if CONFIG_ARM is set.

Agreed. At that point the latest it would perhaps be good to have
Arm have
#define iommu_hap_pt_share true

--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -268,6 +268,13 @@ struct domain_iommu {
  #define iommu_set_feature(d, f)   set_bit(f, dom_iommu(d)->features)
  #define iommu_clear_feature(d, f) clear_bit(f, dom_iommu(d)->features)
+/* Are we using the domain P2M table as its IOMMU pagetable? */
+#define iommu_use_hap_pt(d) \
+    (hap_enabled(d) && is_iommu_enabled(d) && iommu_hap_pt_share)

Does this build for Arm, seeing that there's no hap_enabled()
definition there? Or have I missed its addition earlier in this

--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -963,12 +963,6 @@ static inline bool is_hwdom_pinned_vcpu(const struct vcpu 
              cpumask_weight(v->cpu_hard_affinity) == 1);
-#define need_iommu_pt_sync(d) (dom_iommu(d)->need_sync)
-#define need_iommu_pt_sync(d) false

The "#else" part of this gets lost - is this intentional, i.e.
are there no references left that could be a problem without


Xen-devel mailing list



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