Linus & Alan,
A 2.4 kernel built with SMP or UP_APIC support may hang during boot
if run on a UP P4 machine. The patch below fixes this, please apply.
The events that lead to the hang are:
1. The BIOS boots the OS with the local APIC enabled. cpu_has_apic is true.
2. init_apic_mappings() calls detect_init_APIC().
3. detect_init_APIC() doesn't know about the P4, so it returns failure.
4. init_apic_mappings() maps the local APIC to a dummy page.
5. Much later, APIC_init_uniprocessor() sees that cpu_has_apic is true,
so it calls setup_APIC_clocks().
6. setup_APIC_clocks() calls calibrate_APIC_clock().
7. Since the local APIC was mapped to a dummy page, calibrate_APIC_clock()
doesn't actually touch the HW. It detects and returns a 0 MHz bus clock.
8. setup_APIC_clocks() calls setup_APIC_timer() with the 0 MHz bus clock.
9. setup_APIC_timer() spins in a loop, waiting to APIC_TMCCT to decrement.
But APIC_TMCCT is in the dummy page, so it doesn't change and the
loop never terminates. At this point, you'll see something like:
Using local APIC timer interrupts.
calibrating APIC timer ...
..... CPU clock speed is 1707.5365 MHz.
..... host bus clock speed is 0.0000 MHz.
cpu: 0, clocks: 0, slice: 0
// hangs
The fix simply ensures that detect_init_APIC() doesn't return failure
when running on a P4 with an already enabled local APIC.
/Mikael
--- linux-2.4.13/arch/i386/kernel/apic.c.~1~ Thu Oct 11 13:34:39 2001
+++ linux-2.4.13/arch/i386/kernel/apic.c Sat Oct 27 17:47:49 2001
@@ -588,6 +588,7 @@
goto no_apic;
case X86_VENDOR_INTEL:
if (boot_cpu_data.x86 == 6 ||
+ (boot_cpu_data.x86 == 15 && cpu_has_apic) ||
(boot_cpu_data.x86 == 5 && cpu_has_apic))
break;
goto no_apic;
In article <[email protected]> you wrote:
> Linus & Alan,
> A 2.4 kernel built with SMP or UP_APIC support may hang during boot
> if run on a UP P4 machine. The patch below fixes this, please apply.
can you also try a very recent -ac kernel (smp) and pass "acpismp=force" on
the lilo commandline ?
On Sat, 27 Oct 2001 18:18:58 +0100, [email protected] wrote:
>> A 2.4 kernel built with SMP or UP_APIC support may hang during boot
>> if run on a UP P4 machine. The patch below fixes this, please apply.
>
>can you also try a very recent -ac kernel (smp) and pass "acpismp=force" on
>the lilo commandline ?
Tried 2.4.13-ac3 with CONFIG_SMP=y and acpismp=force.
It's a UP box, no SMP config is found, so get_smp_config()
and config_acpi_tables() are never called. Hangs like before.