diff options
author | Christoph Hellwig <hch@lst.de> | 2010-06-02 18:24:26 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-06-15 01:02:37 -0400 |
commit | f1ba9a5b2ab7d3f5a910d93371c4f22b636b7683 (patch) | |
tree | 027523e8302d0851acd8e472acff9c81030abc94 /arch/powerpc | |
parent | b636f1379eefe6eba931deaa386605bc7ac623e7 (diff) |
powerpc: Unconditionally enabled irq stacks
Irq stacks provide an essential protection from stack overflows through
external interrupts, at the cost of two additionals stacks per CPU.
Enable them unconditionally to simplify the kernel build and prevent
people from accidentally disabling them.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Kconfig.debug | 7 | ||||
-rw-r--r-- | arch/powerpc/include/asm/irq.h | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 12 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_32.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 4 |
8 files changed, 0 insertions, 42 deletions
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index 53696da4518f..2d38a50e66ba 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug | |||
@@ -135,13 +135,6 @@ config DEBUGGER | |||
135 | depends on KGDB || XMON | 135 | depends on KGDB || XMON |
136 | default y | 136 | default y |
137 | 137 | ||
138 | config IRQSTACKS | ||
139 | bool "Use separate kernel stacks when processing interrupts" | ||
140 | help | ||
141 | If you say Y here the kernel will use separate kernel stacks | ||
142 | for handling hard and soft interrupts. This can help avoid | ||
143 | overflowing the process kernel stacks. | ||
144 | |||
145 | config VIRQ_DEBUG | 138 | config VIRQ_DEBUG |
146 | bool "Expose hardware/virtual IRQ mapping via debugfs" | 139 | bool "Expose hardware/virtual IRQ mapping via debugfs" |
147 | depends on DEBUG_FS | 140 | depends on DEBUG_FS |
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h index e054baef1845..ecba37a91749 100644 --- a/arch/powerpc/include/asm/irq.h +++ b/arch/powerpc/include/asm/irq.h | |||
@@ -358,7 +358,6 @@ extern void exc_lvl_ctx_init(void); | |||
358 | #define exc_lvl_ctx_init() | 358 | #define exc_lvl_ctx_init() |
359 | #endif | 359 | #endif |
360 | 360 | ||
361 | #ifdef CONFIG_IRQSTACKS | ||
362 | /* | 361 | /* |
363 | * Per-cpu stacks for handling hard and soft interrupts. | 362 | * Per-cpu stacks for handling hard and soft interrupts. |
364 | */ | 363 | */ |
@@ -369,11 +368,6 @@ extern void irq_ctx_init(void); | |||
369 | extern void call_do_softirq(struct thread_info *tp); | 368 | extern void call_do_softirq(struct thread_info *tp); |
370 | extern int call_handle_irq(int irq, void *p1, | 369 | extern int call_handle_irq(int irq, void *p1, |
371 | struct thread_info *tp, void *func); | 370 | struct thread_info *tp, void *func); |
372 | #else | ||
373 | #define irq_ctx_init() | ||
374 | |||
375 | #endif /* CONFIG_IRQSTACKS */ | ||
376 | |||
377 | extern void do_IRQ(struct pt_regs *regs); | 371 | extern void do_IRQ(struct pt_regs *regs); |
378 | 372 | ||
379 | #endif /* _ASM_IRQ_H */ | 373 | #endif /* _ASM_IRQ_H */ |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 30817d9b20cb..3333bbdd23ef 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -317,7 +317,6 @@ void fixup_irqs(const struct cpumask *map) | |||
317 | } | 317 | } |
318 | #endif | 318 | #endif |
319 | 319 | ||
320 | #ifdef CONFIG_IRQSTACKS | ||
321 | static inline void handle_one_irq(unsigned int irq) | 320 | static inline void handle_one_irq(unsigned int irq) |
322 | { | 321 | { |
323 | struct thread_info *curtp, *irqtp; | 322 | struct thread_info *curtp, *irqtp; |
@@ -358,12 +357,6 @@ static inline void handle_one_irq(unsigned int irq) | |||
358 | if (irqtp->flags) | 357 | if (irqtp->flags) |
359 | set_bits(irqtp->flags, &curtp->flags); | 358 | set_bits(irqtp->flags, &curtp->flags); |
360 | } | 359 | } |
361 | #else | ||
362 | static inline void handle_one_irq(unsigned int irq) | ||
363 | { | ||
364 | generic_handle_irq(irq); | ||
365 | } | ||
366 | #endif | ||
367 | 360 | ||
368 | static inline void check_stack_overflow(void) | 361 | static inline void check_stack_overflow(void) |
369 | { | 362 | { |
@@ -455,7 +448,6 @@ void exc_lvl_ctx_init(void) | |||
455 | } | 448 | } |
456 | #endif | 449 | #endif |
457 | 450 | ||
458 | #ifdef CONFIG_IRQSTACKS | ||
459 | struct thread_info *softirq_ctx[NR_CPUS] __read_mostly; | 451 | struct thread_info *softirq_ctx[NR_CPUS] __read_mostly; |
460 | struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly; | 452 | struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly; |
461 | 453 | ||
@@ -492,10 +484,6 @@ static inline void do_softirq_onstack(void) | |||
492 | irqtp->task = NULL; | 484 | irqtp->task = NULL; |
493 | } | 485 | } |
494 | 486 | ||
495 | #else | ||
496 | #define do_softirq_onstack() __do_softirq() | ||
497 | #endif /* CONFIG_IRQSTACKS */ | ||
498 | |||
499 | void do_softirq(void) | 487 | void do_softirq(void) |
500 | { | 488 | { |
501 | unsigned long flags; | 489 | unsigned long flags; |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index dc66d52dcff5..6bbd7a604d24 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | .text | 34 | .text |
35 | 35 | ||
36 | #ifdef CONFIG_IRQSTACKS | ||
37 | _GLOBAL(call_do_softirq) | 36 | _GLOBAL(call_do_softirq) |
38 | mflr r0 | 37 | mflr r0 |
39 | stw r0,4(r1) | 38 | stw r0,4(r1) |
@@ -56,7 +55,6 @@ _GLOBAL(call_handle_irq) | |||
56 | lwz r0,4(r1) | 55 | lwz r0,4(r1) |
57 | mtlr r0 | 56 | mtlr r0 |
58 | blr | 57 | blr |
59 | #endif /* CONFIG_IRQSTACKS */ | ||
60 | 58 | ||
61 | /* | 59 | /* |
62 | * This returns the high 64 bits of the product of two 64-bit numbers. | 60 | * This returns the high 64 bits of the product of two 64-bit numbers. |
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index a2b18dffa03e..e5144906a56d 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | .text | 29 | .text |
30 | 30 | ||
31 | #ifdef CONFIG_IRQSTACKS | ||
32 | _GLOBAL(call_do_softirq) | 31 | _GLOBAL(call_do_softirq) |
33 | mflr r0 | 32 | mflr r0 |
34 | std r0,16(r1) | 33 | std r0,16(r1) |
@@ -52,7 +51,6 @@ _GLOBAL(call_handle_irq) | |||
52 | ld r0,16(r1) | 51 | ld r0,16(r1) |
53 | mtlr r0 | 52 | mtlr r0 |
54 | blr | 53 | blr |
55 | #endif /* CONFIG_IRQSTACKS */ | ||
56 | 54 | ||
57 | .section ".toc","aw" | 55 | .section ".toc","aw" |
58 | PPC64_CACHES: | 56 | PPC64_CACHES: |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 9d255b4f0a0e..773424df828a 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -1005,7 +1005,6 @@ out: | |||
1005 | return error; | 1005 | return error; |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | #ifdef CONFIG_IRQSTACKS | ||
1009 | static inline int valid_irq_stack(unsigned long sp, struct task_struct *p, | 1008 | static inline int valid_irq_stack(unsigned long sp, struct task_struct *p, |
1010 | unsigned long nbytes) | 1009 | unsigned long nbytes) |
1011 | { | 1010 | { |
@@ -1030,10 +1029,6 @@ static inline int valid_irq_stack(unsigned long sp, struct task_struct *p, | |||
1030 | return 0; | 1029 | return 0; |
1031 | } | 1030 | } |
1032 | 1031 | ||
1033 | #else | ||
1034 | #define valid_irq_stack(sp, p, nb) 0 | ||
1035 | #endif /* CONFIG_IRQSTACKS */ | ||
1036 | |||
1037 | int validate_sp(unsigned long sp, struct task_struct *p, | 1032 | int validate_sp(unsigned long sp, struct task_struct *p, |
1038 | unsigned long nbytes) | 1033 | unsigned long nbytes) |
1039 | { | 1034 | { |
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 8f58986c2ad9..7d84b210f168 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -241,7 +241,6 @@ int __init ppc_init(void) | |||
241 | 241 | ||
242 | arch_initcall(ppc_init); | 242 | arch_initcall(ppc_init); |
243 | 243 | ||
244 | #ifdef CONFIG_IRQSTACKS | ||
245 | static void __init irqstack_early_init(void) | 244 | static void __init irqstack_early_init(void) |
246 | { | 245 | { |
247 | unsigned int i; | 246 | unsigned int i; |
@@ -255,9 +254,6 @@ static void __init irqstack_early_init(void) | |||
255 | __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); | 254 | __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); |
256 | } | 255 | } |
257 | } | 256 | } |
258 | #else | ||
259 | #define irqstack_early_init() | ||
260 | #endif | ||
261 | 257 | ||
262 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) | 258 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) |
263 | static void __init exc_lvl_early_init(void) | 259 | static void __init exc_lvl_early_init(void) |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f3fb5a79de52..643dcac40fcb 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -432,7 +432,6 @@ static u64 slb0_limit(void) | |||
432 | return 1UL << SID_SHIFT; | 432 | return 1UL << SID_SHIFT; |
433 | } | 433 | } |
434 | 434 | ||
435 | #ifdef CONFIG_IRQSTACKS | ||
436 | static void __init irqstack_early_init(void) | 435 | static void __init irqstack_early_init(void) |
437 | { | 436 | { |
438 | u64 limit = slb0_limit(); | 437 | u64 limit = slb0_limit(); |
@@ -451,9 +450,6 @@ static void __init irqstack_early_init(void) | |||
451 | THREAD_SIZE, limit)); | 450 | THREAD_SIZE, limit)); |
452 | } | 451 | } |
453 | } | 452 | } |
454 | #else | ||
455 | #define irqstack_early_init() | ||
456 | #endif | ||
457 | 453 | ||
458 | #ifdef CONFIG_PPC_BOOK3E | 454 | #ifdef CONFIG_PPC_BOOK3E |
459 | static void __init exc_lvl_early_init(void) | 455 | static void __init exc_lvl_early_init(void) |