[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9U-v5aVdVkaVEgV@gmail.com>
Date: Sat, 15 Mar 2025 09:47:59 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>, "H. Peter Anvin" <hpa@...or.com>,
Uros Bizjak <ubizjak@...il.com>,
Andrew Cooper <andrew.cooper3@...rix.com>
Subject: Re: [PATCH 14/20] x86/barrier: Use alternative_io() in 32-bit
barrier functions
* Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Fri, 14 Mar 2025 at 14:09, Josh Poimboeuf <jpoimboe@...nel.org> wrote:
> >
> > Thing is, we still have alternative(), which is also an asm wrapper, but
> > it's for when the caller doesn't care about adding any constraints.
> >
> > So the "_io()" distinguishes from that.
>
> .. but I think it does so very badly because "io" really means
> something else entirely in absolutely all other contexts.
Yeah, alternative_io() is really a misnomer we should fix.
As a minor side note, it's *doubly* a misnomer, because 'io' mixes up
the defined 'o/i' order of the output/input constraints:
arch/x86/include/asm/alternative.h:#define alternative_io(oldinstr, newinstr, ft_flags, output, input...) \
So it should have been alternative_oi().
> And it really makes no sense as "io", since it doesn't take inputs and
> outputs, it takes inputs, outputs AND CLOBBERS.
>
> So it would make more sense to call it "ioc", but that's just obvious
> nonsense, and "ioc" is already taken as a globally recognized
> shorthand for "corruption in sports".
lol ...
> So "ioc" is bad too, but that should make you go "Oh, 'io' is _doubly_
> nonsensical".
>
> Ergo: I think "asm" would be a better distinguishing marker, withg the
> plain "alternative()" being used for particularly simple asms.
Yeah, alternative_asm() or alternative_opts(). Anything but '_io()' :-)
Thanks,
Ingo
Powered by blists - more mailing lists