]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/dom0: Deprecate iommu_hwdom_inclusive and leave it disabled by default
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 31 Dec 2018 14:06:52 +0000 (14:06 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Jan 2019 18:19:52 +0000 (18:19 +0000)
This option is unique to x86 PV dom0's, but it is not sensible to have a
catch-all which blindly maps all non-RAM regions into the IOMMU.

The map-reserved option remains, and covers all the buggy firmware issues that
I am aware of.  The two common cases are legacy USB keyboard emulation, and
the BMC mailbox used by vendor firmware in NICs/HBAs to report information
back to the iLO/iDRAC/etc for remote remote management purposes.

A specific advantage of this change is that x86 dom0's IOMMU setup is now
consistent between PV and PVH.

This change is not expected to have any impact, due to map-reserved remaining.
In the unlikely case that it does cause an issue, we should introduce other
map-$SPECIFIC options rather than re-introducing this catch-all.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
docs/misc/xen-command-line.pandoc
xen/drivers/passthrough/arm/smmu.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/x86/iommu.c
xen/include/xen/iommu.h

index 8b1703d50cc1e577d842ca720924b7c15d70910f..139c4e1d8ac5e3d2e67ab7eb703cef2372f3ee36 100644 (file)
@@ -707,14 +707,16 @@ Controls for the dom0 IOMMU setup.
     Where possible, finer grain corrections should be made with the `rmrr=`,
     `ivrs_hpet=` or `ivrs_ioapic=` command line options.
 
-    This option is enabled by default on x86 systems, and invalid on ARM
-    systems.
+    This option is disabled by default, and deprecated and intended for
+    removal in future versions of Xen.  If specifying `map-inclusive` is the
+    only way to make your system boot, please report a bug.
 
 *   The `map-reserved` functionality is very similar to `map-inclusive`.
 
     The differences from `map-inclusive` are that `map-reserved` is applicable
-    to both x86 PV and PVH dom0's, and represents a subset of the correction
-    by only mapping reserved memory regions rather than all non-RAM regions.
+    to both x86 PV and PVH dom0's, is enabled by default, and represents a
+    subset of the correction by only mapping reserved memory regions rather
+    than all non-RAM regions.
 
 ### dom0_ioports_disable (x86)
 > `= List of <hex>-<hex>`
index 73c8048504b424d063983d3a08eab37ac2edd77e..f151b9f5b5ee18869cc88f2567b6999726d3689c 100644 (file)
@@ -2714,10 +2714,10 @@ static int arm_smmu_iommu_domain_init(struct domain *d)
 static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
 {
        /* Set to false options not supported on ARM. */
-       if ( iommu_hwdom_inclusive == 1 )
+       if ( iommu_hwdom_inclusive )
                printk(XENLOG_WARNING
                "map-inclusive dom0-iommu option is not supported on ARM\n");
-       iommu_hwdom_inclusive = 0;
+       iommu_hwdom_inclusive = false;
        if ( iommu_hwdom_reserved == 1 )
                printk(XENLOG_WARNING
                "map-reserved dom0-iommu option is not supported on ARM\n");
index 9ac9e052a65b103dacf322f8dfd8b6bd99de796f..febb69393ab551ec2798ce1942c0f14ca210fa06 100644 (file)
@@ -38,7 +38,7 @@ bool_t __read_mostly iommu_intremap = 1;
 
 bool __hwdom_initdata iommu_hwdom_strict;
 bool __read_mostly iommu_hwdom_passthrough;
-int8_t __hwdom_initdata iommu_hwdom_inclusive = -1;
+bool __hwdom_initdata iommu_hwdom_inclusive;
 int8_t __hwdom_initdata iommu_hwdom_reserved = -1;
 
 /*
index e40d7a7d7befbe052f266fcc6b5e3ea3b3c034b2..a88ef9b18922de26735e136c5893e25ce272a697 100644 (file)
@@ -214,18 +214,21 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
 
     BUG_ON(!is_hardware_domain(d));
 
-    /* Inclusive mappings are enabled by default for PV. */
-    if ( iommu_hwdom_inclusive == -1 )
-        iommu_hwdom_inclusive = is_pv_domain(d);
     /* Reserved IOMMU mappings are enabled by default. */
     if ( iommu_hwdom_reserved == -1 )
         iommu_hwdom_reserved = 1;
 
-    if ( iommu_hwdom_inclusive && !is_pv_domain(d) )
+    if ( iommu_hwdom_inclusive )
     {
         printk(XENLOG_WARNING
-               "IOMMU inclusive mappings are only supported on PV Dom0\n");
-        iommu_hwdom_inclusive = 0;
+               "IOMMU inclusive mappings are deprecated and will be removed in future versions\n");
+
+        if ( !is_pv_domain(d) )
+        {
+            printk(XENLOG_WARNING
+                   "IOMMU inclusive mappings are only supported on PV Dom0\n");
+            iommu_hwdom_inclusive = false;
+        }
     }
 
     if ( iommu_hwdom_passthrough )
index cdc8021cbdd64c39528cafb882761b1937b3d11a..64a50783cb6c47e7fa40246da17201fc21679688 100644 (file)
@@ -60,8 +60,8 @@ extern bool_t iommu_hap_pt_share;
 extern bool_t iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
 
-extern bool iommu_hwdom_strict, iommu_hwdom_passthrough;
-extern int8_t iommu_hwdom_inclusive, iommu_hwdom_reserved;
+extern bool iommu_hwdom_strict, iommu_hwdom_passthrough, iommu_hwdom_inclusive;
+extern int8_t iommu_hwdom_reserved;
 
 extern unsigned int iommu_dev_iotlb_timeout;