]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix memory corruption at x86-64 SMP bootup
authorAndi Kleen <ak@muc.de>
Sat, 17 Jul 2004 13:48:50 +0000 (06:48 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 17 Jul 2004 13:48:50 +0000 (06:48 -0700)
This fixes a long standing corruption bug in the x86-64 code. The SMP
trampoline would corrupt page 2, which was sometimes used for other
data.  This corrupted the ioport/iomem list in some cases and causes
oopses while read /proc/iomem.

Fix is to check the correct location and don't zero it afterwards
because it gets reinitialized for the next CPU anyways.

Thanks to Alexander Nyberg for tracking it down.

arch/x86_64/kernel/smpboot.c

index 06937402b31c3fc864559e321ff2b0fcbf237c30..29f2578bf5e3fdf697ab26ffa0179ea24522c9ac 100644 (file)
@@ -659,7 +659,7 @@ static void __init do_boot_cpu (int apicid)
                        Dprintk("CPU has booted.\n");
                } else {
                        boot_error = 1;
-                       if (*((volatile unsigned char *)phys_to_virt(8192))
+                       if (*((volatile unsigned char *)phys_to_virt(SMP_TRAMPOLINE_BASE))
                                        == 0xA5)
                                /* trampoline started but...? */
                                printk("Stuck ??\n");
@@ -676,9 +676,6 @@ static void __init do_boot_cpu (int apicid)
                clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */
                cpucount--;
        }
-
-       /* mark "stuck" area as not stuck */
-       *((volatile unsigned *)phys_to_virt(8192)) = 0;
 }
 
 cycles_t cacheflush_time;