提交 6ea5acf8 编写于 作者: P Peter Zijlstra 提交者: Zheng Zengkai

locking/lockdep: Avoid noinstr warning for DEBUG_LOCKDEP

stable inclusion
from stable-5.10.14
commit d2c880ed2cffa50c20a02a70cc41861cf85ff5ef
bugzilla: 48051

--------------------------------

[ Upstream commit 77ca93a6 ]

  vmlinux.o: warning: objtool: lock_is_held_type()+0x60: call to check_flags.part.0() leaves .noinstr.text section
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210106144017.652218215@infradead.orgSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 3cdc48b6
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册