Skip to content

Commit

Permalink
x86: fix cpu hotplug on 32bit
Browse files Browse the repository at this point in the history
commit 3e97047 ("x86: boot secondary
cpus through initial_code") causes the kernel to crash when a CPU is
brought online after the read only sections have been write
protected. The write to initial_code in do_boot_cpu() fails.

Move inital_code to .cpuinit.data section.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Thomas Gleixner committed Jul 27, 2008
1 parent 8be1a6d commit 583323b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,6 @@ is386: movl $2,%ecx # set MP
1:
#endif /* CONFIG_SMP */
jmp *(initial_code)
.align 4
ENTRY(initial_code)
.long i386_start_kernel

/*
* We depend on ET to be correct. This checks for 287/387.
Expand Down Expand Up @@ -601,6 +598,11 @@ ignore_int:
#endif
iret

.section .cpuinit.data,"wa"
.align 4
ENTRY(initial_code)
.long i386_start_kernel

.section .text
/*
* Real beginning of normal "text" segment
Expand Down

0 comments on commit 583323b

Please sign in to comment.