Skip to content

Commit 77ca93a

Browse files
Peter ZijlstraKAGA-KOKO
authored andcommitted
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: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0afda3a commit 77ca93a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kernel/locking/lockdep.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5271,12 +5271,15 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie
52715271
/*
52725272
* Check whether we follow the irq-flags state precisely:
52735273
*/
5274-
static void check_flags(unsigned long flags)
5274+
static noinstr void check_flags(unsigned long flags)
52755275
{
52765276
#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP)
52775277
if (!debug_locks)
52785278
return;
52795279

5280+
/* Get the warning out.. */
5281+
instrumentation_begin();
5282+
52805283
if (irqs_disabled_flags(flags)) {
52815284
if (DEBUG_LOCKS_WARN_ON(lockdep_hardirqs_enabled())) {
52825285
printk("possible reason: unannotated irqs-off.\n");
@@ -5304,6 +5307,8 @@ static void check_flags(unsigned long flags)
53045307

53055308
if (!debug_locks)
53065309
print_irqtrace_events(current);
5310+
5311+
instrumentation_end();
53075312
#endif
53085313
}
53095314

0 commit comments

Comments
 (0)