Re: [PATCH 14/20] x86/barrier: Use alternative_io() in 32-bit barrier functions

From: Linus Torvalds
Date: Fri Mar 14 2025 - 19:50:15 EST


On Fri, 14 Mar 2025 at 11:42, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> +#define mb() alternative_io("lock addl $0,-4(%%esp)", \
> + "mfence", X86_FEATURE_XMM2, \
> + ARG(), \
> + ARG(), \
> + ARG("memory", "cc"))

So all of these patches look like good cleanups to me, but I do wonder
if we should

(a) not use some naming *quite* as generic as 'ARG()'

(b) make the asms use ARG_OUT/ARG_IN/ARG_CLOBBER() to clarify

because that ARG(), ARG(), ARGC() pattern looks odd to me.

Maybe it's just me.

Regardless, I do think the series looks like a nice improvement even
in the current form, even if that particular repeated pattern feels
strange.

Linus