Re: [PATCH v12 2/4] x86/cpu: Check if feature string is non-zero

From: H. Peter Anvin

Date: Mon Mar 30 2026 - 18:02:20 EST


On March 30, 2026 2:15:11 PM PDT, Borislav Petkov <bp@xxxxxxxxx> wrote:
>On Mon, Mar 30, 2026 at 08:42:11PM +0000, Maciej Wieczor-Retman wrote:
>> + * Return the feature's "name" if available, otherwise return the
>> + * feature's bit numerals in "word:bit" format so it's easier to identify.
>
>This "numerals" thing is meh but I see why people use it.
>
>It doesn't get any clearer than "word number and bit position".
>
>> X86_NAMELESS_FEAT_BUF?
>>
>> X86_NUM_FEAT_BUF?
>>
>> Not sure how to make it much more shorter without making it also unreadable.
>
>Yeah, I'm at the same spot as you - I can't think of a better name.
>
>Since it is not too widespread, let's leave the longer, more descriptive one
>and we can change it later if really needed.
>
>Thx.
>

The Right Thing™ would be to have a table in the kernel which includes *all* the feature bit names, not just the ones exported to /proc/cpuinfo, and use the unfiltered string table for kernel messages (/proc/cpuinfo being filtered via a bitmask, list, or a flag in the table.)

I asked Maciej to look into it, and he has been, but I told him to not complicate this patchset too much by trying to fix everything in one shot — because it does ends up touching code in a surprisingly large set of places.

It doesn't help one iota, either, that modprobe is supposed to know what the numeric bit positions mean, either. It is a pretty egregious design error.