[lkml]   [2003]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] local APIC init fixes for 2.4.21-pre5
Marcelo & Alan,

This patch for 2.4.21-pre fixes two local APIC initialisation bugs.
It has been reported to fix serious stability problems with UP kernels
on SMP Athlons. It needs to go in 2.4.21-pre & -ac as soon as possible.

Bug 1: APIC_init_uniprocessor() has a broken write to APIC_ID, forcing
APIC_ID to always be zero for the boot CPU. This causes serious
problems when running UP kernels on SMP Athlons. The fix is to remove
the write altogether, since it's redundant and potentially dangerous.

Bug 2: APIC_init_uniprocessor() incorrectly sets phys_cpu_present_map
to 1 instead of 1 << boot_cpu_physical_apicid. Any machine whose boot
CPU doesn't have ID zero will trigger a BUG() in setup_local_APIC().
The fix is to correct the initialisation of phys_cpu_present_map.


diff -ruN linux-2.4.21-pre5/arch/i386/kernel/apic.c linux-2.4.21-pre5.apic-fixes/arch/i386/kernel/apic.c
--- linux-2.4.21-pre5/arch/i386/kernel/apic.c 2003-02-27 12:58:55.000000000 +0100
+++ linux-2.4.21-pre5.apic-fixes/arch/i386/kernel/apic.c 2003-02-27 13:05:28.000000000 +0100
@@ -649,7 +649,6 @@
set_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability);
mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
- boot_cpu_physical_apicid = 0;
if (nmi_watchdog != NMI_NONE)
nmi_watchdog = NMI_LOCAL_APIC;

@@ -1169,8 +1168,7 @@


- phys_cpu_present_map = 1;
- apic_write_around(APIC_ID, boot_cpu_physical_apicid);
+ phys_cpu_present_map = 1 << boot_cpu_physical_apicid;


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:33    [W:0.047 / U:1.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site