136f1e7a8c
if CONFIG_CALGARY_IOMMU is built into the kernel via CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT, or is enabled via the iommu=calgary boot option, then the detect_calgary() function runs to detect the presence of a Calgary IOMMU. detect_calgary() first searches the BIOS EBDA area for a "rio_table_hdr" BIOS table. It has this parsing algorithm for the EBDA: while (offset) { ... /* The next offset is stored in the 1st word. 0 means no more */ offset = *((unsigned short *)(ptr + offset)); } got that? Lets repeat it slowly: we've got a BIOS-supplied data structure, plus Linux kernel code that will only break out of an infinite parsing loop once the BIOS gives a zero offset. Ok? Translation: what an excellent opportunity for BIOS writers to lock up the Linux boot process in an utterly hard to debug place! Indeed the BIOS jumped on that opportunity on my box, which has the following EBDA chaining layout: 384, 65282, 65535, 65535, 65535, 65535, 65535, 65535 ... see the pattern? So my, definitely non-Calgary system happily locks up in detect_calgary()! the patch below fixes the boot hang by trusting the BIOS-supplied data structure a bit less: the parser always has to make forward progress, and if it doesnt, we break out of the loop and i get the expected kernel message: Calgary: Unable to locate Rio Grande Table in EBDA - bailing! Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Muli Ben-Yehuda <muli@il.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org> |
||
---|---|---|
.. | ||
acpi | ||
cpufreq | ||
aperture.c | ||
apic.c | ||
asm-offsets.c | ||
audit.c | ||
crash_dump.c | ||
crash.c | ||
e820.c | ||
early_printk.c | ||
early-quirks.c | ||
entry.S | ||
functionlist | ||
genapic_cluster.c | ||
genapic_flat.c | ||
genapic.c | ||
head64.c | ||
head.S | ||
i387.c | ||
i8259.c | ||
init_task.c | ||
io_apic.c | ||
ioport.c | ||
irq.c | ||
k8.c | ||
kprobes.c | ||
ldt.c | ||
machine_kexec.c | ||
Makefile | ||
mce_amd.c | ||
mce_intel.c | ||
mce.c | ||
module.c | ||
mpparse.c | ||
nmi.c | ||
pci-calgary.c | ||
pci-dma.c | ||
pci-gart.c | ||
pci-nommu.c | ||
pci-swiotlb.c | ||
pmtimer.c | ||
process.c | ||
ptrace.c | ||
reboot.c | ||
relocate_kernel.S | ||
setup64.c | ||
setup.c | ||
signal.c | ||
smp.c | ||
smpboot.c | ||
stacktrace.c | ||
suspend_asm.S | ||
suspend.c | ||
sys_x86_64.c | ||
syscall.c | ||
tce.c | ||
time.c | ||
trampoline.S | ||
traps.c | ||
vmlinux.lds.S | ||
vsmp.c | ||
vsyscall.c | ||
x8664_ksyms.c |