Re: [PATCH v2 2/2] x86/cpuid: Update bitfields to x86-cpuid-db v3.1

Maciej Wieczor-Retman <[email protected]> Mon, 8 Jun 2026 11:22:30 +0200
Newsgroups dev.linux.lists.x86-cpuid,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 2026-06-08 at 08:34:36 +0200, Ahmed S. Darwish wrote:
>On Thu, 04 Jun 2026, Ingo Molnar wrote:
>>
>> * Maciej Wieczor-Retman <[email protected]> wrote:
>> >
>> > Update leaf_types.h to version 3.1, as generated by x86-cpuid-db.
>> >
>>
>> The following detail from the first submission got lost:
>>
>> > @@ -246,7 +246,7 @@ struct leaf_0x6_0 {
>> > -		thrd_director_nclasses		:  8, // Number of classes, Intel thread director
>> > +		hw_feedback_nclasses		:  8, // Number of Intel Thread Director classes
>> >
>> > Note, for CPUID(0x6) thrd_director_nclasses, it was written this way
>> > because the project does not support bitfields names with more letters.
>>
>> What does this mean exactly, is there a string length limit on the
>> field name in 'struct leaf_0x6_0'? What is the limit?
>>
>
>Sorry, I should've made that more clear in the x86-cpuid-db release notes.
>Yes, there is a limit on field name lenghts so that the C headers formatted
>output is aligned and human readable.  It's an implementation detail.
>
>After Maciej's patch:
>
>    https://gitlab.com/x86-cpuid.org/x86-cpuid-db/-/commit/a7af01507814
>
>I searched for more typos, grammatical mistakes, etc. and fixed some:
>
>    https://gitlab.com/x86-cpuid.org/x86-cpuid-db/-/commit/41380ff73e60
>
>Fixing thrd_director_nclasses name would exceed the project's field limit
>(23 characters), so I checked the manuals, and hw_feedback_nclasses was a
>better name anyway, and thus used it.
>
>That's the whole rationale.
>
>I guess this can be appened to the kernel patch changelog:
>
>  Note, for CPUID(0x6) the "thrd_director_nclasses" field is replaced with
>  "hw_feedback_nclasses" in this x86-cpuid-db release.  Fixing the typo of
>  the former would exceed the project's bitfield names chracter limit, and
>  the latter name is more descriptive.  See [link to x86-cpuid-db commit.]
>
>Thanks,
>Ahmed

Thanks for explaining :)

I thought the name change due to what was in the Intel manual was a better
rationale to put in the kernel patch log. The character limit seemed much more
specific to the cpuid-db project. But I suppose that information could be
benefical in case someone would want, in a kernel discussion, suggest a name
that's >23 characters.

I see the patches were already merged to tip but perhaps in the next release we
could put the character limit information in a comment somewhere in the
tools/arch/x86/kcpuid?

-- 
Kind regards
Maciej Wieczór-Retman