debuggers.hg
changeset 19601:6ba4e34d21d3
intel vtd: Remove the BUG_ON in domain_context_mapping().
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Tue Apr 21 16:31:26 2009 +0100 (2009-04-21) |
parents | 5599cc1e0a84 |
children | cdc044f665dc |
files | xen/drivers/passthrough/vtd/iommu.c |
line diff
1.1 --- a/xen/drivers/passthrough/vtd/iommu.c Tue Apr 21 18:27:59 2009 +0900 1.2 +++ b/xen/drivers/passthrough/vtd/iommu.c Tue Apr 21 16:31:26 2009 +0100 1.3 @@ -1196,7 +1196,20 @@ static int domain_context_mapping(struct 1.4 u8 secbus, secdevfn; 1.5 struct pci_dev *pdev = pci_get_pdev(bus, devfn); 1.6 1.7 - BUG_ON(!pdev); 1.8 + if ( pdev == NULL ) 1.9 + { 1.10 + /* We can reach here by setup_dom0_rmrr() -> iommu_prepare_rmrr_dev() 1.11 + * -> domain_context_mapping(). 1.12 + * In the case a user enables VT-d and disables USB (that usually needs 1.13 + * RMRR) in BIOS, we can't discover the BDF of the USB controller in 1.14 + * setup_dom0_devices(), but the ACPI RMRR structures may still contain 1.15 + * the BDF and at last pci_get_pdev() returns NULL here. 1.16 + */ 1.17 + gdprintk(XENLOG_WARNING VTDPREFIX, 1.18 + "domain_context_mapping: can't find bdf = %x:%x.%x\n", 1.19 + bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); 1.20 + return 0; 1.21 + } 1.22 1.23 drhd = acpi_find_matched_drhd_unit(pdev); 1.24 if ( !drhd )