Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120813
b: refs/heads/master
c: f377fa1
h: refs/heads/master
i:
  120811: f2c21a5
v: v3
  • Loading branch information
Ingo Molnar committed Nov 23, 2008
1 parent 9e16a74 commit c807a2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3aeb95d5b7839708a8d8e11aa274ee4d0d4042cc
refs/heads/master: f377fa123d0ec621e8e361ecc3f2a8ee70e81a2e
25 changes: 10 additions & 15 deletions trunk/arch/x86/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <asm/idle.h>
#include <asm/smp.h>

#ifdef CONFIG_DEBUG_STACKOVERFLOW
/*
* Probabilistic stack overflow check:
*
Expand All @@ -28,20 +27,18 @@
*/
static inline void stack_overflow_check(struct pt_regs *regs)
{
#ifdef CONFIG_DEBUG_STACKOVERFLOW
u64 curbase = (u64)task_stack_page(current);
static unsigned long warned = INITIAL_JIFFIES - 60*HZ;

if (regs->sp >= curbase && regs->sp <= curbase + THREAD_SIZE &&
regs->sp < curbase + sizeof(struct thread_info) +
sizeof(struct pt_regs) + 128 &&
time_after(jiffies, warned + 60*HZ)) {
printk("do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n",
current->comm, curbase, regs->sp);
show_stack(NULL,NULL);
warned = jiffies;
}
}

WARN_ONCE(regs->sp >= curbase &&
regs->sp <= curbase + THREAD_SIZE &&
regs->sp < curbase + sizeof(struct thread_info) +
sizeof(struct pt_regs) + 128,

"do_IRQ: %s near stack overflow (cur:%Lx,sp:%lx)\n",
current->comm, curbase, regs->sp);
#endif
}

/*
* do_IRQ handles all normal device IRQ's (the special
Expand All @@ -61,9 +58,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
irq_enter();
irq = __get_cpu_var(vector_irq)[vector];

#ifdef CONFIG_DEBUG_STACKOVERFLOW
stack_overflow_check(regs);
#endif

desc = irq_to_desc(irq);
if (likely(desc))
Expand Down

0 comments on commit c807a2e

Please sign in to comment.