Re: [patch v5 06/19] x86/cpu: Provide a sane leaf 0xb/0x1f parser

From: Thomas Gleixner
Date: Mon Feb 12 2024 - 10:03:51 EST


On Mon, Feb 12 2024 at 15:17, Thomas Gleixner wrote:
> On Tue, Jan 30 2024 at 20:31, Borislav Petkov wrote:
> TBH, the // comment style is really better for struct definitions. It's
> denser and easier to parse.
>
> // eax
> u32 x2apic_shift : 5, // Number of bits to shift APIC ID right
> // for the topology ID at the next level
> : 27; // Reserved
> // ebx
> u32 num_processors : 16, // Number of processors at current level
> : 16; // Reserved
>
> versus:
>
> /* eax */
> u32 x2apic_shift : 5, /*
> * Number of bits to shift APIC ID right
> * for the topology ID at the next level
> */
> : 27; /* Reserved */
>
> /* ebx */
> u32 num_processors : 16, /* Number of processors at current level */
> : 16; /* Reserved */
>
> Especially x2apic_shift is horrible and the comments of EBX are visually
> impaired while with the C++ comments x2apic_shift looks natural and the
> EBX comments are just open to the right and therefore simpler.

Aside of that it would make the struct generator in the CPUID data base
more complex.