linux/arch/x86_64/kernel
Ingo Molnar 136f1e7a8c [PATCH] x86_64: fix boot time hang in detect_calgary()
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>
2006-12-21 00:08:28 -08:00
..
acpi Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cpufreq [CPUFREQ][4/8] acpi-cpufreq: Mark speedstep-centrino ACPI as deprecated 2006-10-15 19:57:10 -04:00
aperture.c [PATCH] x86: Allow disabling early pci scans with pci=noearly or disallowing conf1 2006-09-26 10:52:41 +02:00
apic.c [PATCH] x86-64: Remove unused GET_APIC_VERSION call from clear_local_APIC 2006-12-07 02:14:11 +01:00
asm-offsets.c [CRYPTO] all: Pass tfm instead of ctx to algorithms 2006-06-26 17:34:39 +10:00
audit.c [PATCH] audit: AUDIT_PERM support 2006-09-11 13:32:30 -04:00
crash_dump.c
crash.c [PATCH] Kexec / Kdump: Unify elf note code 2006-12-07 08:39:46 -08:00
e820.c [PATCH] x86-64: setup saved_max_pfn correctly (kdump) 2006-11-14 16:57:46 +01:00
early_printk.c [PATCH] x86_64: fix 'earlyprintk=...,keep' regression 2006-11-28 10:58:21 -08:00
early-quirks.c [PATCH] x86: fix the irqbalance quirk for E7320/E7520/E7525 2006-12-07 02:14:10 +01:00
entry.S Remove stack unwinder for now 2006-12-15 08:47:51 -08:00
functionlist [NET]: make skb_release_data() static 2006-06-29 16:58:30 -07:00
genapic_cluster.c [PATCH] x86_64 irq: Allocate a vector across all cpus for genapic_flat. 2006-10-08 12:24:02 -07:00
genapic_flat.c [PATCH] x86-64: Put more than one cpu in TARGET_CPUS 2006-10-21 18:37:02 +02:00
genapic.c [PATCH] x86-64: add genapic_force 2006-12-07 02:14:10 +01:00
head64.c [PATCH] x86_64: clear_bss before set_intr_gate with early_idt_handler 2006-12-07 02:14:12 +01:00
head.S [PATCH] Reload CS when startup_64 is used. 2006-09-26 10:52:38 +02:00
i387.c [PATCH] x86-64: use BUILD_BUG_ON in FPU code 2006-12-07 02:14:01 +01:00
i8259.c [PATCH] x86_64: interrupt array size should be aligned to NR_VECTORS 2006-12-07 02:14:12 +01:00
init_task.c [PATCH] nsproxy: move init_nsproxy into kernel/nsproxy.c 2006-10-02 07:57:20 -07:00
io_apic.c [PATCH] x86-64: check vector in setup_ioapic_dest to verify if need setup_IO_APIC_irq 2006-12-07 02:14:19 +01:00
ioport.c [PATCH] x86-64 TIF flags for debug regs and io bitmap in ctxsw 2006-09-26 10:52:28 +02:00
irq.c [PATCH] x86-64: Rate limit no irq handler messages 2006-12-07 02:14:09 +01:00
k8.c [PATCH] x86_64: Clean and enhance up K8 northbridge access code 2006-06-26 10:48:15 -07:00
kprobes.c [PATCH] kprobes: enable booster on the preemptible kernel 2006-12-07 08:39:38 -08:00
ldt.c
machine_kexec.c [PATCH] Avoid overwriting the current pgd (V4, x86_64) 2006-09-26 10:52:38 +02:00
Makefile [PATCH] x86: Refactor thermal throttle processing 2006-09-26 10:52:42 +02:00
mce_amd.c [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00
mce_intel.c [PATCH] x86: Add a cumulative thermal throttle event counter. 2006-09-26 10:52:42 +02:00
mce.c Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
module.c [PATCH] Generic BUG for x86-64 2006-12-08 08:28:39 -08:00
mpparse.c [PATCH] x86-64: remove unused acpi_found_madt in mparse. 2006-12-07 02:14:12 +01:00
nmi.c [PATCH] x86: Fix boot hang due to nmi watchdog init code 2006-12-09 21:33:35 +01:00
pci-calgary.c [PATCH] x86_64: fix boot time hang in detect_calgary() 2006-12-21 00:08:28 -08:00
pci-dma.c [PATCH] Calgary: allow compiling Calgary in but not using it by default 2006-12-07 02:14:07 +01:00
pci-gart.c [PATCH] x86-64: Clarify error message in GART code 2006-12-07 02:14:13 +01:00
pci-nommu.c [PATCH] remove superflous BUG_ON's in nommu and gart 2006-09-26 10:52:32 +02:00
pci-swiotlb.c [PATCH] Move valid_dma_direction() from x86_64 to generic code 2006-09-29 09:18:10 -07:00
pmtimer.c [PATCH] make pmtmr_ioport __read_mostly 2006-06-26 09:58:21 -07:00
process.c [PATCH] x86-64: Fix interrupt race in idle callback (3rd try) 2006-12-07 02:14:13 +01:00
ptrace.c [PATCH] i386/x86-64: rename is_at_popf(), add iret to tests and fix 2006-09-26 10:52:33 +02:00
reboot.c [PATCH] x86_64: Move export symbols to their C functions 2006-06-26 10:48:22 -07:00
relocate_kernel.S [PATCH] Avoid overwriting the current pgd (V4, x86_64) 2006-09-26 10:52:38 +02:00
setup64.c [PATCH] Don't leak NT bit into next task 2006-09-26 10:52:41 +02:00
setup.c Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
signal.c [PATCH] Remove all traces of signal number conversion 2006-09-26 10:52:41 +02:00
smp.c Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
smpboot.c Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
stacktrace.c [PATCH] Merge stacktrace and show_trace 2006-09-26 10:52:34 +02:00
suspend_asm.S [PATCH] Change the name of pagedir_nosave 2006-09-26 08:49:01 -07:00
suspend.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sys_x86_64.c [PATCH] namespaces: utsname: switch to using uts namespaces 2006-10-02 07:57:21 -07:00
syscall.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
tce.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
time.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
trampoline.S [PATCH] Fix gdt table size in trampoline.S 2006-09-26 10:52:32 +02:00
traps.c Remove stack unwinder for now 2006-12-15 08:47:51 -08:00
vmlinux.lds.S Remove stack unwinder for now 2006-12-15 08:47:51 -08:00
vsmp.c [PATCH] Fix build breakage with CONFIG_X86_VSMP 2006-10-12 12:25:27 -07:00
vsyscall.c [PATCH] sysctl: remove unused "context" param 2006-12-10 09:55:41 -08:00
x8664_ksyms.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00