aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irq_64.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-23 03:02:26 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-23 03:04:39 -0500
commitf377fa123d0ec621e8e361ecc3f2a8ee70e81a2e (patch)
tree96009b27707436a44d4b6c09087c1e9d0fb248b3 /arch/x86/kernel/irq_64.c
parent3aeb95d5b7839708a8d8e11aa274ee4d0d4042cc (diff)
x86: clean up stack overflow debug check
Impact: cleanup Simplify the irq-sampled stack overflow debug check: - eliminate an #idef - use WARN_ONCE() to emit a single warning (all bets are off after the first such warning anyway) Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/irq_64.c')
-rw-r--r--arch/x86/kernel/irq_64.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index b842fc82be15..1d3d0e71b044 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -18,7 +18,6 @@
18#include <asm/idle.h> 18#include <asm/idle.h>
19#include <asm/smp.h> 19#include <asm/smp.h>
20 20
21#ifdef CONFIG_DEBUG_STACKOVERFLOW
22/* 21/*
23 * Probabilistic stack overflow check: 22 * Probabilistic stack overflow check:
24 * 23 *
@@ -28,20 +27,18 @@
28 */ 27 */
29static inline void stack_overflow_check(struct pt_regs *regs) 28static inline void stack_overflow_check(struct pt_regs *regs)
30{ 29{
30#ifdef CONFIG_DEBUG_STACKOVERFLOW
31 u64 curbase = (u64)task_stack_page(current); 31 u64 curbase = (u64)task_stack_page(current);
32 static unsigned long warned = INITIAL_JIFFIES - 60*HZ; 32
33 33 WARN_ONCE(regs->sp >= curbase &&
34 if (regs->sp >= curbase && regs->sp <= curbase + THREAD_SIZE && 34 regs->sp <= curbase + THREAD_SIZE &&
35 regs->sp < curbase + sizeof(struct thread_info) + 35 regs->sp < curbase + sizeof(struct thread_info) +
36 sizeof(struct pt_regs) + 128 && 36 sizeof(struct pt_regs) + 128,
37 time_after(jiffies, warned + 60*HZ)) { 37
38 printk("do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n", 38 "do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n",
39 current->comm, curbase, regs->sp); 39 current->comm, curbase, regs->sp);
40 show_stack(NULL,NULL);
41 warned = jiffies;
42 }
43}
44#endif 40#endif
41}
45 42
46/* 43/*
47 * do_IRQ handles all normal device IRQ's (the special 44 * do_IRQ handles all normal device IRQ's (the special
@@ -61,9 +58,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
61 irq_enter(); 58 irq_enter();
62 irq = __get_cpu_var(vector_irq)[vector]; 59 irq = __get_cpu_var(vector_irq)[vector];
63 60
64#ifdef CONFIG_DEBUG_STACKOVERFLOW
65 stack_overflow_check(regs); 61 stack_overflow_check(regs);
66#endif
67 62
68 desc = irq_to_desc(irq); 63 desc = irq_to_desc(irq);
69 if (likely(desc)) 64 if (likely(desc))