diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-04-21 14:59:25 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-04-21 14:59:25 +0100 |
commit | ff7d5444579491e1f94752afa7d56fa5a6a090ef (patch) | |
tree | beefa166cd185faf5d2a8a25acfa44ba255258fd | |
parent | 540488e09a33548ae246faaea0cbdda7a91104f6 (diff) | |
download | xen-ff7d5444579491e1f94752afa7d56fa5a6a090ef.tar.gz xen-ff7d5444579491e1f94752afa7d56fa5a6a090ef.tar.bz2 xen-ff7d5444579491e1f94752afa7d56fa5a6a090ef.zip |
AMD IOV: Fix xen boot on non-iommu systems.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
-rw-r--r-- | xen/drivers/passthrough/amd/iommu_detect.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xen/drivers/passthrough/amd/iommu_detect.c b/xen/drivers/passthrough/amd/iommu_detect.c index 68d04a66a2..d3b51b9830 100644 --- a/xen/drivers/passthrough/amd/iommu_detect.c +++ b/xen/drivers/passthrough/amd/iommu_detect.c @@ -216,24 +216,24 @@ static int __init scan_functions_for_iommu( int bus, int dev, iommu_detect_callback_ptr_t iommu_detect_callback) { int func, hdr_type; - int count, error = 0; + int count = 1, error = 0; + + for ( func = 0; + (func < count) && !error && + VALID_PCI_VENDOR_ID(pci_conf_read16(bus, dev, func, + PCI_VENDOR_ID)); + func++ ) - func = 0; - count = 1; - while ( VALID_PCI_VENDOR_ID(pci_conf_read16(bus, dev, func, - PCI_VENDOR_ID)) && - !error && (func < count) ) { hdr_type = pci_conf_read8(bus, dev, func, PCI_HEADER_TYPE); - if ( func == 0 && IS_PCI_MULTI_FUNCTION(hdr_type) ) + if ( (func == 0) && IS_PCI_MULTI_FUNCTION(hdr_type) ) count = PCI_MAX_FUNC_COUNT; if ( IS_PCI_TYPE0_HEADER(hdr_type) || IS_PCI_TYPE1_HEADER(hdr_type) ) error = scan_caps_for_iommu(bus, dev, func, iommu_detect_callback); - func++; } return error; |