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

[Xen-changelog] [xen-unstable] Revert 20338:5f28661bb2bb



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1255953783 -3600
# Node ID a8b16874a5f0ecd952cf8ef00b62c126cce66be6
# Parent  ad2fd7b94bd32e4256640a908ca3c8b40f505021
Revert 20338:5f28661bb2bb

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/drivers/passthrough/iommu.c        |   10 +++-------
 xen/drivers/passthrough/vtd/intremap.c |    6 ++++--
 xen/drivers/passthrough/vtd/iommu.c    |    5 +++--
 3 files changed, 10 insertions(+), 11 deletions(-)

diff -r ad2fd7b94bd3 -r a8b16874a5f0 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Mon Oct 19 11:58:36 2009 +0100
+++ b/xen/drivers/passthrough/iommu.c   Mon Oct 19 13:03:03 2009 +0100
@@ -266,13 +266,9 @@ int iommu_setup(void)
 {
     int rc = -ENODEV;
 
-    if ( acpi_disabled )
-        iommu_enabled = 0;
-    else
-    {
-        rc = iommu_hardware_setup();
-        iommu_enabled = (rc == 0);
-    }
+    rc = iommu_hardware_setup();
+
+    iommu_enabled = (rc == 0);
 
     if ( force_iommu && !iommu_enabled )
         panic("IOMMU setup failed, crash Xen for security purpose!\n");
diff -r ad2fd7b94bd3 -r a8b16874a5f0 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c    Mon Oct 19 11:58:36 2009 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c    Mon Oct 19 13:03:03 2009 +0100
@@ -575,7 +575,8 @@ void msi_msg_read_remap_rte(
     struct iommu *iommu = NULL;
     struct ir_ctrl *ir_ctrl;
 
-    drhd = acpi_find_matched_drhd_unit(pdev);
+    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+        return;
     iommu = drhd->iommu;
 
     ir_ctrl = iommu_ir_ctrl(iommu);
@@ -593,7 +594,8 @@ void msi_msg_write_remap_rte(
     struct iommu *iommu = NULL;
     struct ir_ctrl *ir_ctrl;
 
-    drhd = acpi_find_matched_drhd_unit(pdev);
+    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+        return;
     iommu = drhd->iommu;
 
     ir_ctrl = iommu_ir_ctrl(iommu);
diff -r ad2fd7b94bd3 -r a8b16874a5f0 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Mon Oct 19 11:58:36 2009 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Mon Oct 19 13:03:03 2009 +0100
@@ -1349,7 +1349,8 @@ static int reassign_device_ownership(
     if (!pdev)
         return -ENODEV;
 
-    drhd = acpi_find_matched_drhd_unit(pdev);
+    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+        return -ENODEV;
     pdev_iommu = drhd->iommu;
     domain_context_unmap(source, bus, devfn);
 
@@ -1363,7 +1364,7 @@ static int reassign_device_ownership(
     for_each_pdev ( source, pdev )
     {
         drhd = acpi_find_matched_drhd_unit(pdev);
-        if ( drhd->iommu == pdev_iommu )
+        if ( drhd && drhd->iommu == pdev_iommu )
         {
             found = 1;
             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®.