From: Roger Pau Monné Date: Fri, 2 Dec 2016 17:09:11 +0000 (+0100) Subject: vtd: refuse to enable IOMMU if the PCI scan fails X-Git-Tag: 4.9.0-rc1~1129 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=295f4c8bc2e6da4a4442efa115da4e1b393b3672;p=xen.git vtd: refuse to enable IOMMU if the PCI scan fails This provides uniform behavior between Intel and AMD IOMMU initialization, and is a requirement for PVHv2 Dom0, that depends on a working IOMMU plus the PCI bus being scanned for devices. Signed-off-by: Roger Pau Monné Acked-by: Kevin Tian --- diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 48f120b13c..78b5a6ac02 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -2299,7 +2299,9 @@ int __init intel_vtd_setup(void) P(iommu_hap_pt_share, "Shared EPT tables"); #undef P - scan_pci_devices(); + ret = scan_pci_devices(); + if ( ret ) + goto error; ret = init_vtd_hw(); if ( ret )