Re: [PATCH v3 1/6] x86/bugs: Rename entry_ibpb()
From: Josh Poimboeuf
Date: Wed Apr 02 2025 - 14:44:35 EST
On Wed, Apr 02, 2025 at 08:29:28PM +0200, Borislav Petkov wrote:
> On Wed, Apr 02, 2025 at 11:19:18AM -0700, Josh Poimboeuf wrote:
> > There's nothing entry-specific about entry_ibpb(). In preparation for
>
> Not anymore - it was done on entry back then AFAIR.
>
> > calling it from elsewhere, rename it to __write_ibpb().
> >
> > Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> > ---
> > arch/x86/entry/entry.S | 7 ++++---
> > arch/x86/include/asm/nospec-branch.h | 6 +++---
> > arch/x86/kernel/cpu/bugs.c | 6 +++---
> > 3 files changed, 10 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/x86/entry/entry.S b/arch/x86/entry/entry.S
> > index d3caa31240ed..3a53319988b9 100644
> > --- a/arch/x86/entry/entry.S
> > +++ b/arch/x86/entry/entry.S
> > @@ -17,7 +17,8 @@
> >
> > .pushsection .noinstr.text, "ax"
> >
> > -SYM_FUNC_START(entry_ibpb)
> > +// Clobbers AX, CX, DX
>
> Why the ugly comment style if the rest of the file is already using the
> multiline one...
It helps it stand out more? :-)
> > +SYM_FUNC_START(__write_ibpb)
>
> ... and why the __ ?
I was thinking the calling interface is a bit nonstandard. But actually
it's fine to call from C as those registers are already caller-saved
anyway. So yeah, let's drop the '__'.
--
Josh