Commit 24b79d7c authored by Hugh Dickins's avatar Hugh Dickins Committed by David S. Miller

[PATCH] demystify do_boot_cpu stack

Anyone experimenting with different THREAD_SIZE or PAGE_SIZE on i386
runs into magical mystery numbers in do_boot_cpu esp initialization.
Remove those and use the same stack top in startup_32 as thereafter.

Oh, and what's that phys_to_virt(8192)?  Goodness! it's actually the
trampoline_base we (hopefully) got from early alloc_bootmem_low_pages.
Yes, could do with a lot more cleanup, but I'll stick here for safety.
parent 5ef6ba88
...@@ -813,7 +813,8 @@ static void __init do_boot_cpu (int apicid) ...@@ -813,7 +813,8 @@ static void __init do_boot_cpu (int apicid)
/* So we see what's up */ /* So we see what's up */
printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip); printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip);
stack_start.esp = (void *) (1024 + PAGE_SIZE + (char *)idle->thread_info); /* Stack for startup_32 can be just as for start_secondary onwards */
stack_start.esp = (void *) idle->thread.esp;
/* /*
* This grunge runs the startup process for * This grunge runs the startup process for
...@@ -882,7 +883,7 @@ static void __init do_boot_cpu (int apicid) ...@@ -882,7 +883,7 @@ static void __init do_boot_cpu (int apicid)
Dprintk("CPU has booted.\n"); Dprintk("CPU has booted.\n");
} else { } else {
boot_error= 1; boot_error= 1;
if (*((volatile unsigned char *)phys_to_virt(8192)) if (*((volatile unsigned char *)trampoline_base)
== 0xA5) == 0xA5)
/* trampoline started but...? */ /* trampoline started but...? */
printk("Stuck ??\n"); printk("Stuck ??\n");
...@@ -904,7 +905,7 @@ static void __init do_boot_cpu (int apicid) ...@@ -904,7 +905,7 @@ static void __init do_boot_cpu (int apicid)
} }
/* mark "stuck" area as not stuck */ /* mark "stuck" area as not stuck */
*((volatile unsigned long *)phys_to_virt(8192)) = 0; *((volatile unsigned long *)trampoline_base) = 0;
if(clustered_apic_mode) { if(clustered_apic_mode) {
printk("Restoring NMI vector\n"); printk("Restoring NMI vector\n");
......
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