diff -r bbad08b156e9 -r 072ffd2fa8f7 xen/drivers/passthrough/vtd/dmar.c --- a/xen/drivers/passthrough/vtd/dmar.c Thu Jan 21 14:08:42 2010 +0900 +++ b/xen/drivers/passthrough/vtd/dmar.c Thu Jan 21 16:39:46 2010 +0900 @@ -397,7 +397,34 @@ if ( ret ) xfree(dmaru); else - acpi_register_drhd_unit(dmaru); + { + u8 b, d, f; + int i, ignore = 0; + + for ( i = 0; i < dmaru->scope.devices_cnt; i++ ) + { + b = PCI_BUS(dmaru->scope.devices[i]); + d = PCI_SLOT(dmaru->scope.devices[i]); + f = PCI_FUNC(dmaru->scope.devices[i]); + + if ( pci_device_detect(b, d, f) == 0 ) + { + ignore = 1; + break; + } + } + + if ( ignore ) + { + dprintk(XENLOG_WARNING VTDPREFIX, + " Ignore the DRHD due to " + "devices under its scope are not PCI discoverable!\n"); + xfree(dmaru); + } + else + acpi_register_drhd_unit(dmaru); + } + return ret; }