lockdep: annotate do_debug() trap handler
PATCH 1/1 lockdep: annotate do_debug() trap handler
Subject: lockdep: annotate do_debug() trap handler
Ensure the hardirq state is consistent before using locks. Use the rare trace_hardirqs_fixup() because the trap can happen in any context.
Signed-off-by Peter Zijlstra <[email protected]>
--- arch/x86/kernel/traps_32.c | 2 ++ arch/x86/kernel/traps_64.c | 2 ++ 2 files changed, 4 insertions(+)
arch/x86/kernel/traps_32.c +2 -0
@@ -830,6 +830,8 @@ fastcall void __kprobes do_debug(structunsigned int condition;struct task_struct *tsk = current; +trace_hardirqs_fixup (); +get_debugreg (condition,6 ); if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
arch/x86/kernel/traps_64.c +2 -0
@@ -840,6 +840,8 @@ asmlinkage void __kprobes do_debug(strucstruct task_struct *tsk = current;siginfo_t info; +trace_hardirqs_fixup (); +get_debugreg (condition,6 ); if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,