Re: [v3 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

From: Andy Lutomirski
Date: Thu Oct 25 2018 - 19:16:42 EST


On Wed, Oct 24, 2018 at 12:16 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> On Tue, Oct 23, 2018 at 11:43 AM Chang S. Bae <chang.seok.bae@xxxxxxxxx> wrote:

> > +/*
> > + * Interrupts are disabled here. Out of line to be protected from kprobes.
> > + */
> > +static noinline __kprobes unsigned long rd_inactive_gsbase(void)
> > +{
> > + unsigned long gsbase, flags;
> > +
> > + local_irq_save(flags);
> > + native_swapgs();
> > + gsbase = rdgsbase();
> > + native_swapgs();
> > + local_irq_restore(flags);
> > +
> > + return gsbase;
> > +}
>
> Please fold this into its only caller and make *that* noinline.
>

On further reading of the whole series, I retract this particular
comment. But I do think that __rdgsbase_inactive() would be a better
name.