jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds
authorPeter Zijlstra <peterz@infradead.org>
Mon, 2 May 2022 10:30:20 +0000 (12:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:23 +0000 (18:36 +0200)
commit38d432f4b391b734740d1493c8e64cb46fb6ca74
tree394b3b1b2c33b0267bb51cc3534d970de919d752
parent0853f905e48b92dcf27a8d931104c9aac10de191
jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds

[ Upstream commit 656d054e0a15ec327bd82801ccd58201e59f6896 ]

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@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/jump_label.h