[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 1/3] x86: Rearrange struct cpuinfo_x86 to introduce a vfm field
Intel have run out of model space in Family 6 and will start using Family 19 starting with Diamond Rapids. Xen, like Linux, has model checking logic which will malfunction owing to bad assumptions about the family field. Reorder the family, vendor and model fields so they can be accessed together as a single vfm field. As we're cleaning up the logic, take the opportunity to introduce better names, dropping the x86 prefix. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- CC: Jan Beulich <JBeulich@xxxxxxxx> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- xen/arch/x86/include/asm/cpufeature.h | 28 +++++++++++++++++++++++---- xen/arch/x86/setup.c | 4 +++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h index 3c2ac964e410..707b134c09c7 100644 --- a/xen/arch/x86/include/asm/cpufeature.h +++ b/xen/arch/x86/include/asm/cpufeature.h @@ -20,10 +20,30 @@ #ifndef __ASSEMBLY__ struct cpuinfo_x86 { - unsigned char x86; /* CPU family */ - unsigned char x86_vendor; /* CPU vendor */ - unsigned char x86_model; - unsigned char x86_mask; + /* TODO: Phase out the x86 prefixed names. */ + union { + struct { + union { + uint8_t x86_model; + uint8_t model; + }; + union { + uint8_t x86; + uint8_t family; + }; + union { + uint8_t x86_vendor; + uint8_t vendor; + }; + uint8_t _rsvd; + }; + uint32_t vfm; /* Vendor Family Model */ + }; + union { + uint8_t x86_mask; + uint8_t stepping; + }; + unsigned int cpuid_level; /* Maximum supported CPUID level */ unsigned int extended_cpuid_level; /* Maximum supported CPUID extended level */ unsigned int x86_capability[NCAPINTS]; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 24e4f5ac7f5d..37421ac9d05b 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -178,7 +178,9 @@ void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info); /* Used by the boot asm and EFI to stash the multiboot_info paddr. */ unsigned int __initdata multiboot_ptr; -struct cpuinfo_x86 __read_mostly boot_cpu_data = { 0, 0, 0, 0, -1 }; +struct cpuinfo_x86 __read_mostly boot_cpu_data = { + .cpuid_level = -1, +}; unsigned long __read_mostly mmu_cr4_features = XEN_MINIMAL_CR4; -- 2.39.5
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |