diff options
author | Brian Gerst <brgerst@gmail.com> | 2009-01-18 22:21:28 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-01-19 22:29:20 -0500 |
commit | 947e76cdc34c782fc947313d4331380686eebbad (patch) | |
tree | de5d424c4760269fd7800bc745e48b060c725300 /arch/x86/kernel/cpu/common.c | |
parent | 8c7e58e690ae60ab4215b025f433ed4af261e103 (diff) |
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>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index f83a4d6160f0..098934e72a16 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -881,12 +881,13 @@ __setup("clearcpuid=", setup_disablecpuid); | |||
881 | #ifdef CONFIG_X86_64 | 881 | #ifdef CONFIG_X86_64 |
882 | struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; | 882 | struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; |
883 | 883 | ||
884 | DEFINE_PER_CPU_PAGE_ALIGNED(char[IRQ_STACK_SIZE], irq_stack); | 884 | DEFINE_PER_CPU_FIRST(union irq_stack_union, |
885 | irq_stack_union) __aligned(PAGE_SIZE); | ||
885 | #ifdef CONFIG_SMP | 886 | #ifdef CONFIG_SMP |
886 | DEFINE_PER_CPU(char *, irq_stack_ptr); /* will be set during per cpu init */ | 887 | DEFINE_PER_CPU(char *, irq_stack_ptr); /* will be set during per cpu init */ |
887 | #else | 888 | #else |
888 | DEFINE_PER_CPU(char *, irq_stack_ptr) = | 889 | DEFINE_PER_CPU(char *, irq_stack_ptr) = |
889 | per_cpu_var(irq_stack) + IRQ_STACK_SIZE - 64; | 890 | per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64; |
890 | #endif | 891 | #endif |
891 | 892 | ||
892 | DEFINE_PER_CPU(unsigned long, kernel_stack) = | 893 | DEFINE_PER_CPU(unsigned long, kernel_stack) = |
@@ -960,7 +961,7 @@ void __cpuinit cpu_init(void) | |||
960 | 961 | ||
961 | loadsegment(fs, 0); | 962 | loadsegment(fs, 0); |
962 | loadsegment(gs, 0); | 963 | loadsegment(gs, 0); |
963 | load_pda_offset(cpu); | 964 | load_gs_base(cpu); |
964 | 965 | ||
965 | #ifdef CONFIG_NUMA | 966 | #ifdef CONFIG_NUMA |
966 | if (cpu != 0 && percpu_read(node_number) == 0 && | 967 | if (cpu != 0 && percpu_read(node_number) == 0 && |