Re: [PATCH 04/20] x86/cpu: Use named asm operands in clflushopt()

From: Ingo Molnar
Date: Sat Mar 15 2025 - 05:25:28 EST



* Ingo Molnar <mingo@xxxxxxxxxx> wrote:

>
> * Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> > On Fri, Mar 14, 2025 at 01:46:00PM -1000, Linus Torvalds wrote:
> > > On Fri, 14 Mar 2025 at 11:42, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> > > >
> > > > + alternative_io(".byte 0x3e; clflush %[val]",
> > > > + ".byte 0x66; clflush %[val]", X86_FEATURE_CLFLUSHOPT,
> > > > + [val] "+m" (*(volatile char __force *)__p));
> > >
> > > Hmm. I think we could just use 'clflushopt', it looks like it exists
> > > in binutils-2.25, which is our minimal version requirement.
> > >
> > > But maybe that's a separate cleanup.
> >
> > You appear to be correct, I'll add a patch for that.
>
> Please base your series on tip:master or tip:x86/asm, we already
> cleaned this up recently:
>
> cc2e9e09d1a3 ("x86/asm: Use CLFLUSHOPT and CLWB mnemonics in <asm/special_insns.h>")

Also, as a general principle I'd prefer to have .byte conversion to
mnemonics and named-operands conversions to be separate patches - not
all named-operands conversions are an improvement, especially very
short and simple asm() templates are just fine using numeric operands.

Thanks,

Ingo