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-devel

[Xen-devel] [PATCH]Remove the BUG_ON in domain_context_mapping()

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]Remove the BUG_ON in domain_context_mapping()
From: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Date: Tue, 21 Apr 2009 19:38:26 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: "Han, Weidong" <weidong.han@xxxxxxxxx>
Delivery-date: Tue, 21 Apr 2009 04:40:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnCda+Jdyv57ah8RbaY6URvoGr0dA==
Thread-topic: [PATCH]Remove the BUG_ON in domain_context_mapping()
Remove the BUG_ON in domain_context_mapping().

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>

diff -r 655dc3bc1d8e xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c   Thu Apr 16 11:54:06 2009 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c   Thu Apr 16 12:03:27 2009 +0800
@@ -1196,7 +1196,20 @@ static int domain_context_mapping(struct
     u8 secbus, secdevfn;
     struct pci_dev *pdev = pci_get_pdev(bus, devfn);

-    BUG_ON(!pdev);
+    if ( pdev == NULL )
+    {
+        /* We can reach here by setup_dom0_rmrr() -> iommu_prepare_rmrr_dev()
+         * -> domain_context_mapping().
+         * In the case a user enables VT-d and disables USB (that usually needs
+         * RMRR) in BIOS, we can't discover the BDF of the USB controller in
+         * setup_dom0_devices(), but the ACPI RMRR structures may still contain
+         * the BDF and at last pci_get_pdev() returns NULL here.
+         */
+        gdprintk(XENLOG_WARNING VTDPREFIX,
+                "domain_context_mapping: can't find bdf = %x:%x.%x\n",
+                 bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+        return 0;
+    }

     drhd = acpi_find_matched_drhd_unit(pdev);
     if ( !drhd )
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]Remove the BUG_ON in domain_context_mapping(), Cui, Dexuan <=