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/include/asm/stackprotector.h | |
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/include/asm/stackprotector.h')
-rw-r--r-- | arch/x86/include/asm/stackprotector.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h index 2383e5bb475c..36a700acaf2b 100644 --- a/arch/x86/include/asm/stackprotector.h +++ b/arch/x86/include/asm/stackprotector.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_STACKPROTECTOR_H 1 | 2 | #define _ASM_STACKPROTECTOR_H 1 |
3 | 3 | ||
4 | #include <asm/tsc.h> | 4 | #include <asm/tsc.h> |
5 | #include <asm/pda.h> | 5 | #include <asm/processor.h> |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Initialize the stackprotector canary value. | 8 | * Initialize the stackprotector canary value. |
@@ -19,7 +19,7 @@ static __always_inline void boot_init_stack_canary(void) | |||
19 | * Build time only check to make sure the stack_canary is at | 19 | * Build time only check to make sure the stack_canary is at |
20 | * offset 40 in the pda; this is a gcc ABI requirement | 20 | * offset 40 in the pda; this is a gcc ABI requirement |
21 | */ | 21 | */ |
22 | BUILD_BUG_ON(offsetof(struct x8664_pda, stack_canary) != 40); | 22 | BUILD_BUG_ON(offsetof(union irq_stack_union, stack_canary) != 40); |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We both use the random pool and the current TSC as a source | 25 | * We both use the random pool and the current TSC as a source |
@@ -32,7 +32,7 @@ static __always_inline void boot_init_stack_canary(void) | |||
32 | canary += tsc + (tsc << 32UL); | 32 | canary += tsc + (tsc << 32UL); |
33 | 33 | ||
34 | current->stack_canary = canary; | 34 | current->stack_canary = canary; |
35 | write_pda(stack_canary, canary); | 35 | percpu_write(irq_stack_union.stack_canary, canary); |
36 | } | 36 | } |
37 | 37 | ||
38 | #endif | 38 | #endif |