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

[Xen-changelog] [xen-unstable] IOMMU: Fail if intremap is not available and iommu=required/force.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306394324 -3600
# Node ID f979a1a69fe3cd0f14a26bbd40e50fe29c95e339
# Parent  a44b12ee2fd37a66a616a1b93a6aa2f8bbb25f90
IOMMU: Fail if intremap is not available and iommu=required/force.

Rather than sprinkling panic()s throughout the setup code hoist the
check up into common code.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r a44b12ee2fd3 -r f979a1a69fe3 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Wed May 25 10:45:24 2011 +0100
+++ b/xen/drivers/passthrough/iommu.c   Thu May 26 08:18:44 2011 +0100
@@ -311,6 +311,7 @@
 int __init iommu_setup(void)
 {
     int rc = -ENODEV;
+    bool_t force_intremap = force_iommu && iommu_intremap;
 
     if ( iommu_dom0_strict )
         iommu_passthrough = 0;
@@ -321,8 +322,10 @@
         iommu_enabled = (rc == 0);
     }
 
-    if ( force_iommu && !iommu_enabled )
-        panic("IOMMU setup failed, crash Xen for security purpose!\n");
+    if ( (force_iommu && !iommu_enabled) ||
+         (force_intremap && !iommu_intremap) )
+        panic("Couldn't enable %s and iommu=required/force\n",
+              !iommu_enabled ? "IOMMU" : "Interrupt Remapping");
 
     if ( !iommu_enabled )
     {
diff -r a44b12ee2fd3 -r f979a1a69fe3 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Wed May 25 10:45:24 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Thu May 26 08:18:44 2011 +0100
@@ -1971,8 +1971,6 @@
                     "ioapic_to_iommu: ioapic 0x%x (id: 0x%x) is NULL! "
                     "Will not try to enable Interrupt Remapping.\n",
                     apic, IO_APIC_ID(apic));
-                if ( force_iommu )
-                    panic("intremap remapping failed to enable with 
iommu=required/force in grub\n");
                 break;
             }
         }
@@ -1984,11 +1982,10 @@
             iommu = drhd->iommu;
             if ( enable_intremap(iommu, 0) != 0 )
             {
+                iommu_intremap = 0;
                 dprintk(XENLOG_WARNING VTDPREFIX,
                         "Interrupt Remapping not enabled\n");
 
-                if ( force_iommu && platform_supports_intremap() )
-                    panic("intremap remapping failed to enable with 
iommu=required/force in grub\n");
                 break;
             }
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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