Commit 32f5543d authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix memory corruption at x86-64 SMP bootup

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.
parent f044bba3
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment