lockdep: Noinstr annotate warn_bogus_irq_restore()
authorPeter Zijlstra <peterz@infradead.org>
Tue, 9 Feb 2021 08:30:03 +0000 (09:30 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 10 Feb 2021 13:44:39 +0000 (14:44 +0100)
  vmlinux.o: warning: objtool: lock_is_held_type()+0x107: call to warn_bogus_irq_restore() leaves .noinstr.text section

As per the general rule that WARNs are allowed to violate noinstr to
get out, annotate it away.

Fixes: 997acaf6b4b5 ("lockdep: report broken irq restoration")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lkml.kernel.org/r/YCKyYg53mMp4E7YI@hirez.programming.kicks-ass.net
kernel/locking/irqflag-debug.c

index 9603d20..810b503 100644 (file)
@@ -4,8 +4,10 @@
 #include <linux/export.h>
 #include <linux/irqflags.h>
 
-void warn_bogus_irq_restore(void)
+noinstr void warn_bogus_irq_restore(void)
 {
+       instrumentation_begin();
        WARN_ONCE(1, "raw_local_irq_restore() called with IRQs enabled\n");
+       instrumentation_end();
 }
 EXPORT_SYMBOL(warn_bogus_irq_restore);