Re: [PATCH 05/12] x86/mm: add INVLPGB support code

From: Rik van Riel
Date: Mon Jan 06 2025 - 12:33:14 EST


On Mon, 2025-01-06 at 08:50 -0800, Dave Hansen wrote:
> On 1/2/25 04:42, Borislav Petkov wrote:
> > > +#define INVLPGB_VA BIT(0)
> > > +#define INVLPGB_PCID BIT(1)
> > > +#define INVLPGB_ASID BIT(2)
> > > +#define INVLPGB_INCLUDE_GLOBAL BIT(3)
> > > +#define INVLPGB_FINAL_ONLY BIT(4)
> > > +#define INVLPGB_INCLUDE_NESTED BIT(5)
> > Please add only the defines which are actually being used. Ditto
> > for the
> > functions.
>
> There's some precedent for defining them all up front, like we did
> for
> invpcid_flush_*().
>
> For INVPCID, there are four variants and two of them got used up
> front.
> But I get that it's a balancing act between having untested code that
> might bitrot and introducing helpers at a time when someone (Rik) is
> very likely to get all the variants coded up correctly.
>
> Rik, how many of these end up being used by the end of the series?
>

Only invlpgb_flush_single_asid is unused at the
end of the series.

I'll remove that one.

As for the bit flags, those are a hardware
interface. I can remove the unused ones, but
would like to know why :)

--
All Rights Reversed.