[<prev] [next>] [day] [month] [year] [list]
Message-ID: <165390712965.4207.7873247519209876133.tip-bot2@tip-bot2>
Date: Mon, 30 May 2022 10:38:49 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: kernel test robot <lkp@...el.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: objtool/urgent] jump_label,noinstr: Avoid instrumentation for
JUMP_LABEL=n builds
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: 656d054e0a15ec327bd82801ccd58201e59f6896
Gitweb: https://git.kernel.org/tip/656d054e0a15ec327bd82801ccd58201e59f6896
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Mon, 02 May 2022 12:30:20 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Fri, 27 May 2022 12:34:44 +02:00
jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds
When building x86_64 with JUMP_LABEL=n it's possible for
instrumentation to sneak into noinstr:
vmlinux.o: warning: objtool: exit_to_user_mode+0x14: call to static_key_count.constprop.0() leaves .noinstr.text section
vmlinux.o: warning: objtool: syscall_exit_to_user_mode+0x2d: call to static_key_count.constprop.0() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_exit_to_user_mode+0x1b: call to static_key_count.constprop.0() leaves .noinstr.text section
Switch to arch_ prefixed atomic to avoid the explicit instrumentation.
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
include/linux/jump_label.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 107751c..bf1eef3 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -256,9 +256,9 @@ extern void static_key_disable_cpuslocked(struct static_key *key);
#include <linux/atomic.h>
#include <linux/bug.h>
-static inline int static_key_count(struct static_key *key)
+static __always_inline int static_key_count(struct static_key *key)
{
- return atomic_read(&key->enabled);
+ return arch_atomic_read(&key->enabled);
}
static __always_inline void jump_label_init(void)
Powered by blists - more mailing lists