[xen-unstable] vt-d: Some fixes of Intel iommu

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen-unstable] vt-d: Some fixes of Intel iommu

Xen patchbot-unstable
# HG changeset patch
# User Keir Fraser <[hidden email]>
# Date 1195911623 0
# Node ID b92239112869819849028a7f333ed439bf2c8bd4
# Parent  483329e219c97cd8317f751976ee495df5fdc883
vt-d: Some fixes of Intel iommu

This patch removes a wrong if condition judgement to setup rmrr
identify mapping for guests, and passes page count rather than address
size to iommu_flush_iotlb_psi().

Signed-off-by: Weidong Han <[hidden email]>
Signed-off-by: Anthony Xu <[hidden email]>
---
 xen/arch/x86/hvm/vmx/vtd/intel-iommu.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff -r 483329e219c9 -r b92239112869 xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
--- a/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c Sat Nov 24 13:39:13 2007 +0000
+++ b/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c Sat Nov 24 13:40:23 2007 +0000
@@ -1538,7 +1538,7 @@ int iommu_page_mapping(struct domain *do
     {
         iommu = drhd->iommu;
         if ( cap_caching_mode(iommu->cap) )
-            iommu_flush_iotlb_psi(iommu, domain->domain_id, iova, size, 0);
+            iommu_flush_iotlb_psi(iommu, domain->domain_id, iova, index, 0);
         else if ( cap_rwbf(iommu->cap) )
             iommu_flush_write_buffer(iommu);
     }
@@ -1726,13 +1726,11 @@ static void setup_dom0_rmrr(void)
 
     for_each_rmrr_device ( rmrr, pdev )
         ret = iommu_prepare_rmrr_dev(dom0, rmrr, pdev);
-
-    if ( ret )
-        gdprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: mapping reserved region failed\n");
-
+        if ( ret )
+            gdprintk(XENLOG_ERR VTDPREFIX,
+                     "IOMMU: mapping reserved region failed\n");
     end_for_each_rmrr_device ( rmrr, pdev )
-        }
+}
 
 int iommu_setup(void)
 {
@@ -1798,7 +1796,6 @@ int device_assigned(u8 bus, u8 devfn)
 
 int assign_device(struct domain *d, u8 bus, u8 devfn)
 {
-    struct hvm_iommu *hd  = domain_hvm_iommu(d);
     struct acpi_rmrr_unit *rmrr;
     struct pci_dev *pdev;
     int ret = 0;
@@ -1813,14 +1810,17 @@ int assign_device(struct domain *d, u8 b
     reassign_device_ownership(dom0, d, bus, devfn);
 
     /* setup rmrr identify mapping just once per domain */
-    if ( list_empty(&hd->pdev_list) )
-        for_each_rmrr_device(rmrr, pdev)
-            ret = iommu_prepare_rmrr_dev(d, rmrr, pdev);
-    if ( ret )
-        gdprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: mapping reserved region failed\n");
+    for_each_rmrr_device(rmrr, pdev)
+        ret = iommu_prepare_rmrr_dev(d, rmrr, pdev);
+        if ( ret )
+        {
+            gdprintk(XENLOG_ERR VTDPREFIX,
+                     "IOMMU: mapping reserved region failed\n");
+            return ret;
+        }
     end_for_each_rmrr_device(rmrr, pdev)
-        return ret;
+
+    return ret;
 }
 
 void iommu_set_pgd(struct domain *d)

_______________________________________________
Xen-changelog mailing list
[hidden email]
http://lists.xensource.com/xen-changelog