[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-cvs
Subject:    [Xen-changelog] [xen-4.0-testing] IOMMU: Fail if intremap is not
From:       "Xen patchbot-4.0-testing" <patchbot () xen ! org>
Date:       2011-05-31 20:25:10
Message-ID: E1QRVV1-0006XW-6V () xenbits ! xen ! org
[Download RAW message or body]

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1306571380 -3600
# Node ID b11ae09ae58b11e0283132edd572b856d382b05d
# Parent  5768b9b19aaf85be21bb9e5673ca3bcb95178907
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@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   23402:f979a1a69fe3
xen-unstable date:        Thu May 26 08:18:44 2011 +0100
---


diff -r 5768b9b19aaf -r b11ae09ae58b xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Sat May 28 09:28:28 2011 +0100
+++ b/xen/drivers/passthrough/iommu.c	Sat May 28 09:29:40 2011 +0100
@@ -308,6 +308,7 @@
 int iommu_setup(void)
 {
     int rc = -ENODEV;
+    bool_t force_intremap = force_iommu && iommu_intremap;
 
     if ( iommu_dom0_strict )
         iommu_passthrough = 0;
@@ -318,8 +319,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 5768b9b19aaf -r b11ae09ae58b xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Sat May 28 09:28:28 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Sat May 28 09:29:40 2011 +0100
@@ -1908,6 +1908,7 @@
             iommu = drhd->iommu;
             if ( enable_intremap(iommu, 0) != 0 )
             {
+                iommu_intremap = 0;
                 dprintk(XENLOG_WARNING VTDPREFIX,
                         "Failed to enable Interrupt Remapping!\n");
                 break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic