Re: [PATCH RESEND v2 3/3] x86/cpu: Enable modifying bug flags with {clear,set}puid

From: Borislav Petkov
Date: Mon Feb 17 2025 - 06:53:43 EST


On Mon, Feb 17, 2025 at 12:20:56PM +0100, Brendan Jackman wrote:
> On Mon, 17 Feb 2025 at 12:10, Borislav Petkov <bp@xxxxxxxxx> wrote:
> >
> > > extern const char * const x86_bug_flags[NBUGINTS*32];
> > > +#define x86_bug_flag(flag) x86_bug_flags[flag]
> >
> > Why?
>
> That's just for consistency with x86_cap_flag().
>
> I don't remember seeing any reason why that indirection exists. Maybe
> it's vestigial. Shall I just remove it?

Wondering the same. Both arrays are automatically generated into capflags.c as

const char * const x86_cap_flags[NCAPINTS*32] = {
const char * const x86_bug_flags[NBUGINTS*32] = {

so it's not like something is going to change them at runtime so what's the
point of the wrapper I dunno...

/me greps some...

Oh, I know:

-#ifdef CONFIG_X86_FEATURE_NAMES
extern const char * const x86_cap_flags[NCAPINTS*32];
extern const char * const x86_power_flags[32];
#define X86_CAP_FMT "%s"
#define x86_cap_flag(flag) x86_cap_flags[flag]
-#else
-#define X86_CAP_FMT X86_CAP_FMT_NUM
-#define x86_cap_flag x86_cap_flag_num
-#endif

from 7583e8fbdc49a4dbd916d14863cf1deeddb982f9

So yeah, it is a useless leftover now. So please remove.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette