Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/asm: Use CLFLUSHOPT and CLWB mnemonics in <asm/special_insns.h>

Current minimum required version of binutils is 2.25,
which supports CLFLUSHOPT and CLWB instruction mnemonics.

Replace the byte-wise specification of CLFLUSHOPT and
CLWB with these proper mnemonics.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250313102715.333142-1-ubizjak@gmail.com

authored by

Uros Bizjak and committed by
Ingo Molnar
53286632 21fe2514

+6 -10
+6 -10
arch/x86/include/asm/special_insns.h
··· 176 176 177 177 static inline void clflushopt(volatile void *__p) 178 178 { 179 - alternative_io(".byte 0x3e; clflush %0", 180 - ".byte 0x66; clflush %0", 181 - X86_FEATURE_CLFLUSHOPT, 179 + alternative_io("ds clflush %0", 180 + "clflushopt %0", X86_FEATURE_CLFLUSHOPT, 182 181 "+m" (*(volatile char __force *)__p)); 183 182 } 184 183 ··· 186 187 volatile struct { char x[64]; } *p = __p; 187 188 188 189 asm volatile(ALTERNATIVE_2( 189 - ".byte 0x3e; clflush (%[pax])", 190 - ".byte 0x66; clflush (%[pax])", /* clflushopt (%%rax) */ 191 - X86_FEATURE_CLFLUSHOPT, 192 - ".byte 0x66, 0x0f, 0xae, 0x30", /* clwb (%%rax) */ 193 - X86_FEATURE_CLWB) 194 - : [p] "+m" (*p) 195 - : [pax] "a" (p)); 190 + "ds clflush %0", 191 + "clflushopt %0", X86_FEATURE_CLFLUSHOPT, 192 + "clwb %0", X86_FEATURE_CLWB) 193 + : "+m" (*p)); 196 194 } 197 195 198 196 #ifdef CONFIG_X86_USER_SHADOW_STACK