]> Git Repo - linux.git/commitdiff
x86, AMD IOMMU: include amd_iommu_last_bdf in device initialization
authorJoerg Roedel <[email protected]>
Fri, 25 Jul 2008 11:07:50 +0000 (13:07 +0200)
committerIngo Molnar <[email protected]>
Sat, 26 Jul 2008 13:45:57 +0000 (15:45 +0200)
All the values read while searching for amd_iommu_last_bdf are defined as
inclusive. Let the code handle this value as such. Found by Wei Wang. Thanks
Wei.

Signed-off-by: Joerg Roedel <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Wei Wang <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/amd_iommu_init.c

index c25210e6ac888e94224b460e6eb82f3c556d7616..74697408576f4b2e1f5bfaa5ede78247d34e455f 100644 (file)
@@ -667,7 +667,7 @@ static int get_device_resources(struct device *dev,
        _bdf = calc_devid(pcidev->bus->number, pcidev->devfn);
 
        /* device not translated by any IOMMU in the system? */
-       if (_bdf >= amd_iommu_last_bdf) {
+       if (_bdf > amd_iommu_last_bdf) {
                *iommu = NULL;
                *domain = NULL;
                *bdf = 0xffff;
@@ -1085,7 +1085,7 @@ void prealloc_protection_domains(void)
 
        while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
                devid = (dev->bus->number << 8) | dev->devfn;
-               if (devid >= amd_iommu_last_bdf)
+               if (devid > amd_iommu_last_bdf)
                        continue;
                devid = amd_iommu_alias_table[devid];
                if (domain_for_device(devid))
index c9d8ff2eb130b3ed384bc525ef13a5c4784161d7..d9a9da597e796cbcda869180879a7804888e70ea 100644 (file)
@@ -732,7 +732,7 @@ static int __init init_exclusion_range(struct ivmd_header *m)
                set_device_exclusion_range(m->devid, m);
                break;
        case ACPI_IVMD_TYPE_ALL:
-               for (i = 0; i < amd_iommu_last_bdf; ++i)
+               for (i = 0; i <= amd_iommu_last_bdf; ++i)
                        set_device_exclusion_range(i, m);
                break;
        case ACPI_IVMD_TYPE_RANGE:
@@ -934,7 +934,7 @@ int __init amd_iommu_init(void)
        /*
         * let all alias entries point to itself
         */
-       for (i = 0; i < amd_iommu_last_bdf; ++i)
+       for (i = 0; i <= amd_iommu_last_bdf; ++i)
                amd_iommu_alias_table[i] = i;
 
        /*
This page took 0.051346 seconds and 4 git commands to generate.