From: Andi Kleen Date: Mon, 8 May 2006 13:17:19 +0000 (+0200) Subject: [PATCH] x86_64: Check for too many northbridges in IOMMU code X-Git-Tag: v2.6.17-rc4~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5192d84e4c32cd335fd572e5ff0712041f45f7e7;p=platform%2Fkernel%2Flinux-3.10.git [PATCH] x86_64: Check for too many northbridges in IOMMU code The IOMMU code can only deal with 8 northbridges. Error out when more are found. Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index 9d3d76c..2480d3f 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c @@ -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);