summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2024-04-04 11:42:01 +0200
committerIngo Molnar <mingo@kernel.org>2024-04-06 12:42:17 +0200
commit4c3677c077582f8665806def3f6dd35587793c69 (patch)
tree30fc627ebc1ef58d13a3d16b76596f69f2618d63
parent9ebe5500d4b25ee4cde04eec59a6764361a60709 (diff)
downloadlinux-stable-4c3677c077582f8665806def3f6dd35587793c69.tar.gz
linux-stable-4c3677c077582f8665806def3f6dd35587793c69.tar.bz2
linux-stable-4c3677c077582f8665806def3f6dd35587793c69.zip
x86/percpu: Fix x86_this_cpu_variable_test_bit() asm template
Fix x86_this_cpu_variable_test_bit(), which is implemented with an incorrect asm template, where argument 2 (count argument) is considered a percpu variable. However, x86_this_cpu_test_bit() is currently used exclusively with constant bit number argument, so the called x86_this_cpu_variable_test_bit() function is never instantiated. The fix introduces named assembler operands to prevent this kind of error. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: https://lore.kernel.org/r/20240404094218.448963-1-ubizjak@gmail.com
-rw-r--r--arch/x86/include/asm/percpu.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 20696df5d567..cbfbbe836ee2 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -586,10 +586,11 @@ static inline bool x86_this_cpu_variable_test_bit(int nr,
{
bool oldbit;
- asm volatile("btl "__percpu_arg(2)",%1"
+ asm volatile("btl %[nr], " __percpu_arg([var])
CC_SET(c)
: CC_OUT(c) (oldbit)
- : "m" (*__my_cpu_ptr((unsigned long __percpu *)(addr))), "Ir" (nr));
+ : [var] "m" (*__my_cpu_ptr((unsigned long __percpu *)(addr))),
+ [nr] "Ir" (nr));
return oldbit;
}