summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-05-08 15:17:19 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-08 09:34:56 -0700
commit5192d84e4c32cd335fd572e5ff0712041f45f7e7 (patch)
treecff2adc01b146cb240c6e9e8662374d969a50284 /arch
parente0c1e9bf81badc7ba59e120d6218101903d5d103 (diff)
downloadop-kernel-dev-5192d84e4c32cd335fd572e5ff0712041f45f7e7.zip
op-kernel-dev-5192d84e4c32cd335fd572e5ff0712041f45f7e7.tar.gz
[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 <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kernel/pci-gart.c8
1 files changed, 8 insertions, 0 deletions
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);
OpenPOWER on IntegriCloud