x86: move stack_canary into irq_stack
Impact: x86_64 percpu area layout change, irq_stack now at the beginning
Now that the PDA is empty except for the stack canary, it can be removed.
The irqstack is moved to the start of the per-cpu section. If the stack
protector is enabled, the canary overlaps the bottom 48 bytes of the irqstack.
tj: * updated subject
* dropped asm relocation of irq_stack_ptr
* updated comments a bit
* rebased on top of stack canary changes
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -242,13 +242,10 @@ ENTRY(secondary_startup_64)
|
||||
|
||||
/* Set up %gs.
|
||||
*
|
||||
* On SMP, %gs should point to the per-cpu area. For initial
|
||||
* boot, make %gs point to the init data section. For a
|
||||
* secondary CPU,initial_gs should be set to its pda address
|
||||
* before the CPU runs this code.
|
||||
*
|
||||
* On UP, initial_gs points to PER_CPU_VAR(__pda) and doesn't
|
||||
* change.
|
||||
* The base of %gs always points to the bottom of the irqstack
|
||||
* union. If the stack protector canary is enabled, it is
|
||||
* located at %gs:40. Note that, on SMP, the boot cpu uses
|
||||
* init data section till per cpu areas are set up.
|
||||
*/
|
||||
movl $MSR_GS_BASE,%ecx
|
||||
movq initial_gs(%rip),%rax
|
||||
@@ -281,7 +278,7 @@ ENTRY(secondary_startup_64)
|
||||
#ifdef CONFIG_SMP
|
||||
.quad __per_cpu_load
|
||||
#else
|
||||
.quad PER_CPU_VAR(__pda)
|
||||
.quad PER_CPU_VAR(irq_stack_union)
|
||||
#endif
|
||||
__FINITDATA
|
||||
|
||||
|
||||
Reference in New Issue
Block a user