[PATCH 01/20] x86/cpu: Use named asm operands in prefetch[w]()

From: Josh Poimboeuf
Date: Fri Mar 14 2025 - 17:48:10 EST


Use named operands in preparation for removing the operand numbering
restrictions in alternative_input().

Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
arch/x86/include/asm/processor.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 5d2f7e5aff26..2e9566134949 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -613,7 +613,7 @@ extern char ignore_fpu_irq;
# define BASE_PREFETCH ""
# define ARCH_HAS_PREFETCH
#else
-# define BASE_PREFETCH "prefetcht0 %1"
+# define BASE_PREFETCH "prefetcht0 %[val]"
#endif

/*
@@ -624,9 +624,9 @@ extern char ignore_fpu_irq;
*/
static inline void prefetch(const void *x)
{
- alternative_input(BASE_PREFETCH, "prefetchnta %1",
- X86_FEATURE_XMM,
- "m" (*(const char *)x));
+ alternative_input(BASE_PREFETCH,
+ "prefetchnta %[val]", X86_FEATURE_XMM,
+ [val] "m" (*(const char *)x));
}

/*
@@ -636,9 +636,9 @@ static inline void prefetch(const void *x)
*/
static __always_inline void prefetchw(const void *x)
{
- alternative_input(BASE_PREFETCH, "prefetchw %1",
- X86_FEATURE_3DNOWPREFETCH,
- "m" (*(const char *)x));
+ alternative_input(BASE_PREFETCH,
+ "prefetchw %[val]", X86_FEATURE_3DNOWPREFETCH,
+ [val] "m" (*(const char *)x));
}

#define TOP_OF_INIT_STACK ((unsigned long)&init_stack + sizeof(init_stack) - \
--
2.48.1