]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
passthrough: rework hwdom_pvh_reqs to use it also on ARM
authorJulien Grall <julien.grall@linaro.org>
Wed, 14 May 2014 08:49:17 +0000 (10:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 May 2014 08:49:17 +0000 (10:49 +0200)
Hardware domain on ARM will have the same requirements as hwdom PVH when iommu
is enabled. Both PVH and ARM guest has paging mode translate enabled, so Xen
can use it to know if it needs to check the requirements.

Rename the function and remove "pvh" word in the panic message.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/drivers/passthrough/iommu.c

index 96a79cece574029c9ac197f2857e3cade35bfd85..ccb354d27028df90536fd53dd3dc6c76dac43f16 100644 (file)
@@ -130,13 +130,17 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
-static void __hwdom_init check_hwdom_pvh_reqs(struct domain *d)
+static void __hwdom_init check_hwdom_reqs(struct domain *d)
 {
+    if ( !paging_mode_translate(d) )
+        return;
+
     if ( !iommu_enabled )
         panic("Presently, iommu must be enabled for pvh dom0\n");
 
     if ( iommu_passthrough )
-        panic("For pvh dom0, dom0-passthrough must not be enabled\n");
+        panic("Dom0 uses paging translated mode, dom0-passthrough must not be "
+              "enabled\n");
 
     iommu_dom0_strict = 1;
 }
@@ -145,8 +149,7 @@ void __hwdom_init iommu_hwdom_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
-    if ( is_pvh_domain(d) )
-        check_hwdom_pvh_reqs(d);
+    check_hwdom_reqs(d);
 
     if ( !iommu_enabled )
         return;