[PATCH] x86_64: Check for too many northbridges in IOMMU code
authorAndi Kleen <ak@suse.de>
Mon, 8 May 2006 13:17:19 +0000 (15:17 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 8 May 2006 16:34:56 +0000 (09:34 -0700)
The IOMMU code can only deal with 8 northbridges. Error out when
more are found.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/kernel/pci-gart.c

index 9d3d76c85ae7160ea9def9af5ccb4d133370ffbe..2480d3f08a470865b90f1dd8cb35e2c6c30a9e1a 100644 (file)
@@ -639,6 +639,14 @@ static int __init pci_iommu_init(void)
                return -1;
        }
 
+       i = 0;
+       for_all_nb(dev)
+               i++;
+       if (i > MAX_NB) {
+               printk(KERN_ERR "PCI-GART: Too many northbridges (%ld). Disabled\n", i);
+               return -1;
+       }
+
        printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n");
        aper_size = info.aper_size * 1024 * 1024;       
        iommu_size = check_iommu_size(info.aper_base, aper_size);