WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.0-testing] amd iommu: Fix a xen crash after pci-a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] amd iommu: Fix a xen crash after pci-attach
From: "Xen patchbot-4.0-testing" <patchbot@xxxxxxx>
Date: Thu, 10 Feb 2011 21:35:11 -0800
Delivery-date: Thu, 10 Feb 2011 21:35:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1297328645 0
# Node ID 11db1234d89afc7834b07b6547dbe2b5f2e56725
# Parent  90c7e62a49c90fd14865696526d7749df44fd0cb
amd iommu: Fix a xen crash after pci-attach

pci-detach triggers IO page table deallocation if the last passthru
device has been removed from pdev list, and this will result a BUG on
amd systems for next pci-attach. This patch fixes this issue.

Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>
xen-unstable changeset:   22872:cba9a84d32fb
xen-unstable date:        Sun Feb 06 16:54:01 2011 +0000
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    6 ++++++
 1 files changed, 6 insertions(+)

diff -r 90c7e62a49c9 -r 11db1234d89a xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c       Wed Feb 09 09:02:12 
2011 +0000
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c       Thu Feb 10 09:04:05 
2011 +0000
@@ -277,6 +277,7 @@ static int reassign_device( struct domai
     struct pci_dev *pdev;
     struct amd_iommu *iommu;
     int bdf;
+    struct hvm_iommu *t = domain_hvm_iommu(target);
 
     ASSERT(spin_is_locked(&pcidevs_lock));
     pdev = pci_get_pdev_by_domain(source, bus, devfn);
@@ -297,6 +298,11 @@ static int reassign_device( struct domai
 
     list_move(&pdev->domain_list, &target->arch.pdev_list);
     pdev->domain = target;
+
+    /* IO page tables might be destroyed after pci-detach the last device
+     * In this case, we have to re-allocate root table for next pci-attach.*/
+    if ( t->root_table == NULL )
+        allocate_domain_resources(t);
 
     amd_iommu_setup_domain_device(target, iommu, bdf);
     AMD_IOMMU_DEBUG("reassign %x:%x.%x domain %d -> domain %d\n",

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] amd iommu: Fix a xen crash after pci-attach, Xen patchbot-4.0-testing <=