[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <171240167793.10875.5486559736366474315.tip-bot2@tip-bot2>
Date: Sat, 06 Apr 2024 11:07:57 -0000
From: "tip-bot2 for Uros Bizjak" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Uros Bizjak <ubizjak@...il.com>, Ingo Molnar <mingo@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/percpu] x86/percpu: Fix x86_this_cpu_variable_test_bit()
asm template
The following commit has been merged into the x86/percpu branch of tip:
Commit-ID: 4c3677c077582f8665806def3f6dd35587793c69
Gitweb: https://git.kernel.org/tip/4c3677c077582f8665806def3f6dd35587793c69
Author: Uros Bizjak <ubizjak@...il.com>
AuthorDate: Thu, 04 Apr 2024 11:42:01 +02:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Sat, 06 Apr 2024 12:42:17 +02:00
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@...il.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "H. Peter Anvin" <hpa@...or.com>
Link: https://lore.kernel.org/r/20240404094218.448963-1-ubizjak@gmail.com
---
arch/x86/include/asm/percpu.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 20696df..cbfbbe8 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;
}
Powered by blists - more mailing lists