summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-04-30 11:07:20 +0200
committerThomas Gleixner <tglx@linutronix.de>2020-06-11 15:15:01 +0200
commit75347bb2535a6d5549cc3e436467b7c40d7bb874 (patch)
tree9f80675ad14ca97ae6a4618085b878b53e211f59 /arch
parent9347f41352181bf4a7e663f7b5f4a4bb32244d73 (diff)
downloadlinux-75347bb2535a6d5549cc3e436467b7c40d7bb874.tar.bz2
x86/traps: Address objtool noinstr complaints in #DB
The functions invoked from handle_debug() can be instrumented. Tell objtool about it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Andy Lutomirski <luto@kernel.org> Link: https://lkml.kernel.org/r/20200505135315.380927730@linutronix.de
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/traps.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b62e962871f2..41bb0cb9df84 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -784,14 +784,19 @@ static void noinstr handle_debug(struct pt_regs *regs, unsigned long dr6,
/* Store the virtualized DR6 value */
tsk->thread.debugreg6 = dr6;
+ instrumentation_begin();
#ifdef CONFIG_KPROBES
- if (kprobe_debug_handler(regs))
+ if (kprobe_debug_handler(regs)) {
+ instrumentation_end();
return;
+ }
#endif
if (notify_die(DIE_DEBUG, "debug", regs, (long)&dr6, 0,
- SIGTRAP) == NOTIFY_STOP)
+ SIGTRAP) == NOTIFY_STOP) {
+ instrumentation_end();
return;
+ }
/*
* Let others (NMI) know that the debug stack is in use
@@ -827,6 +832,7 @@ static void noinstr handle_debug(struct pt_regs *regs, unsigned long dr6,
out:
cond_local_irq_disable(regs);
debug_stack_usage_dec();
+ instrumentation_end();
}
static __always_inline void exc_debug_kernel(struct pt_regs *regs,