aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/traps_32.c8
-rw-r--r--include/asm-x86/kprobes.h9
2 files changed, 7 insertions, 10 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 0429c5de5ea..203b863ac2a 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -84,6 +84,12 @@ static unsigned int code_bytes = 64;
static int ignore_nmis;
static int die_counter;
+static inline void conditional_sti(struct pt_regs *regs)
+{
+ if (regs->flags & X86_EFLAGS_IF)
+ local_irq_enable();
+}
+
void printk_address(unsigned long address, int reliable)
{
#ifdef CONFIG_KALLSYMS
@@ -859,7 +865,7 @@ void __kprobes do_int3(struct pt_regs *regs, long error_code)
* This is an interrupt gate, because kprobes wants interrupts
* disabled. Normal trap handlers don't.
*/
- restore_interrupts(regs);
+ conditional_sti(regs);
do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL);
}
diff --git a/include/asm-x86/kprobes.h b/include/asm-x86/kprobes.h
index bd8407863c1..8a0748d0103 100644
--- a/include/asm-x86/kprobes.h
+++ b/include/asm-x86/kprobes.h
@@ -82,15 +82,6 @@ struct kprobe_ctlblk {
struct prev_kprobe prev_kprobe;
};
-/* trap3/1 are intr gates for kprobes. So, restore the status of IF,
- * if necessary, before executing the original int3/1 (trap) handler.
- */
-static inline void restore_interrupts(struct pt_regs *regs)
-{
- if (regs->flags & X86_EFLAGS_IF)
- local_irq_enable();
-}
-
extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
extern int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data);