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

[Xen-changelog] [xen master] xen/dom0: Deprecate iommu_hwdom_inclusive and leave it disabled by default



commit b7e8dee07cdc9714d79a2d4eb524c17705a596e4
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Dec 31 14:06:52 2018 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Jan 23 18:19:52 2019 +0000

    xen/dom0: Deprecate iommu_hwdom_inclusive and leave it disabled by default
    
    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@xxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 docs/misc/xen-command-line.pandoc   | 10 ++++++----
 xen/drivers/passthrough/arm/smmu.c  |  4 ++--
 xen/drivers/passthrough/iommu.c     |  2 +-
 xen/drivers/passthrough/x86/iommu.c | 15 +++++++++------
 xen/include/xen/iommu.h             |  4 ++--
 5 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc 
b/docs/misc/xen-command-line.pandoc
index 8b1703d50c..139c4e1d8a 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -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>`
diff --git a/xen/drivers/passthrough/arm/smmu.c 
b/xen/drivers/passthrough/arm/smmu.c
index 73c8048504..f151b9f5b5 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -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");
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9ac9e052a6..febb69393a 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -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;
 
 /*
diff --git a/xen/drivers/passthrough/x86/iommu.c 
b/xen/drivers/passthrough/x86/iommu.c
index e40d7a7d7b..a88ef9b189 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -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 )
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index cdc8021cbd..64a50783cb 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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