lkml.org 
[lkml]   [2024]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/74] x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86
On Thu, Mar 28, 2024 at 09:37:44AM -0700, Tony Luck wrote:
> Refactor struct cpuinfo_x86 so that the vendor, family, and model
> fields are overlayed in a union with a 32-bit field that combines
> all three (together with a one byte reserved field in the upper
> byte).
>
> This will make it easy, cheap, and reliable to check all three
> values at once.
>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
> arch/x86/include/asm/processor.h | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
> index 811548f131f4..87115e5d884f 100644
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -108,9 +108,15 @@ struct cpuinfo_topology {
> };
>
> struct cpuinfo_x86 {
> - __u8 x86; /* CPU family */
> - __u8 x86_vendor; /* CPU vendor */
> - __u8 x86_model;
> + union {
> + struct {
> + __u8 x86_vendor; /* CPU vendor */
> + __u8 x86; /* CPU family */
> + __u8 x86_model;
> + __u8 x86_reserved;
> + };
> + __u32 x86_vfm; /* combined vendor, family, model */
> + };
> __u8 x86_stepping;

Why are you leaving out stepping?

And since we want to simplify all this, why aren't we replacing all
f/m/s checks by using the whole CPUID(1).EAX u32 instead?

Then the macros need to build that CPUID leaf simply.

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2024-05-27 16:14    [W:0.104 / U:1.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site