diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/kprobes_32.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/traps_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/traps_64.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/fault_32.c | 5 | ||||
-rw-r--r-- | arch/x86/mm/fault_64.c | 5 |
6 files changed, 16 insertions, 12 deletions
diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c index 90f778c04b3..d87a523070d 100644 --- a/arch/x86/kernel/kprobes_32.c +++ b/arch/x86/kernel/kprobes_32.c @@ -564,12 +564,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) resume_execution(cur, regs, kcb); regs->eflags |= kcb->kprobe_saved_eflags; -#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT - if (raw_irqs_disabled_flags(regs->eflags)) - trace_hardirqs_off(); - else - trace_hardirqs_on(); -#endif + trace_hardirqs_fixup_flags(regs->eflags); /*Restore back the original saved kprobes variables and continue. */ if (kcb->kprobe_status == KPROBE_REENTER) { diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c index 681b801c5e2..3db3611933d 100644 --- a/arch/x86/kernel/kprobes_64.c +++ b/arch/x86/kernel/kprobes_64.c @@ -551,12 +551,7 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs) resume_execution(cur, regs, kcb); regs->eflags |= kcb->kprobe_saved_rflags; -#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT - if (raw_irqs_disabled_flags(regs->eflags)) - trace_hardirqs_off(); - else - trace_hardirqs_on(); -#endif + trace_hardirqs_fixup_flags(regs->eflags); /* Restore the original saved kprobes variables and continue. */ if (kcb->kprobe_status == KPROBE_REENTER) { diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index cc9acace7e2..298d13ed3ab 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c @@ -789,6 +789,8 @@ void restart_nmi(void) #ifdef CONFIG_KPROBES fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code) { + trace_hardirqs_fixup(); + if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) return; diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index d0c2bc7ab2e..4a6bd4965f5 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c @@ -807,6 +807,8 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs) /* runs on IST stack. */ asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code) { + trace_hardirqs_fixup(); + if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { return; } diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index 503dfc05111..2e542e89a3e 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c @@ -303,6 +303,11 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, int write, si_code; int fault; + /* + * We can fault from pretty much anywhere, with unknown IRQ state. + */ + trace_hardirqs_fixup(); + /* get the address */ address = read_cr2(); diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c index 644b4f7ece1..0e26230669c 100644 --- a/arch/x86/mm/fault_64.c +++ b/arch/x86/mm/fault_64.c @@ -304,6 +304,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long flags; siginfo_t info; + /* + * We can fault from pretty much anywhere, with unknown IRQ state. + */ + trace_hardirqs_fixup(); + tsk = current; mm = tsk->mm; prefetchw(&mm->mmap_sem); |