Skip to content

Commit 656d054

Browse files
author
Peter Zijlstra
committed
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
1 parent a6a5eb2 commit 656d054

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/jump_label.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ extern void static_key_disable_cpuslocked(struct static_key *key);
256256
#include <linux/atomic.h>
257257
#include <linux/bug.h>
258258

259-
static inline int static_key_count(struct static_key *key)
259+
static __always_inline int static_key_count(struct static_key *key)
260260
{
261-
return atomic_read(&key->enabled);
261+
return arch_atomic_read(&key->enabled);
262262
}
263263

264264
static __always_inline void jump_label_init(void)

0 commit comments

Comments
 (0)