Commit 77ca93a6 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner

locking/lockdep: Avoid noinstr warning for DEBUG_LOCKDEP

  vmlinux.o: warning: objtool: lock_is_held_type()+0x60: call to check_flags.part.0() leaves .noinstr.text section
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210106144017.652218215@infradead.org
parent 0afda3a8
...@@ -5271,12 +5271,15 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie ...@@ -5271,12 +5271,15 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie
/* /*
* Check whether we follow the irq-flags state precisely: * Check whether we follow the irq-flags state precisely:
*/ */
static void check_flags(unsigned long flags) static noinstr void check_flags(unsigned long flags)
{ {
#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) #if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP)
if (!debug_locks) if (!debug_locks)
return; return;
/* Get the warning out.. */
instrumentation_begin();
if (irqs_disabled_flags(flags)) { if (irqs_disabled_flags(flags)) {
if (DEBUG_LOCKS_WARN_ON(lockdep_hardirqs_enabled())) { if (DEBUG_LOCKS_WARN_ON(lockdep_hardirqs_enabled())) {
printk("possible reason: unannotated irqs-off.\n"); printk("possible reason: unannotated irqs-off.\n");
...@@ -5304,6 +5307,8 @@ static void check_flags(unsigned long flags) ...@@ -5304,6 +5307,8 @@ static void check_flags(unsigned long flags)
if (!debug_locks) if (!debug_locks)
print_irqtrace_events(current); print_irqtrace_events(current);
instrumentation_end();
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment