[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86: Remove x86 prefixed names from cpuinfo


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Wed, 12 Nov 2025 20:18:00 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CCh5AUiAieRdltULojbrVcpXSJCkFme0QwiMZmkzfi8=; b=ytyjRLx0LPGRZz6tSqeg2U0sms0HME9LffOrx9uTpk3sXUM9muBtAGm/6Yqa4rfpQYB7+jzksvAyHn7FbBJAze8qHYytSWfUGCIT8qILbCVcr7W4KK6ykZgQib6VbSaI5OmPQ3emIT+tSf+A9C+pNBp+Xqw9SZgYGWCP61C+uebaXobxq6WhmI0dBp5EGVGjR6bjEZeltXTsQSwELlUMOjU0pkPiGJ4R/4AH2kmqdWRbY+5HZX/PhpMUzEpAtuxfXnEKlWKMqLrxEd3TDvmIURDgD65jzZCy4L7YyMDQC00JAxSPdK0l+MY/EfuTzLWdSdcQu1131iMeTetep61v2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=he2Ab6zWD3G1/xTjfVRt7av5MLDQ4rYIQP7UWGxsWzIkvufswVEnwzVoajvl93mZspoDVomXwSgElyhzcHrpyLEBMjRHVrH1hfh3XeFJq1fhmkF/JhMwRQ7u8A7YQemEBvQSghUqOfPgmGzdhwBl9IROOpqs4TQdHXQQAQwPAhdxZyoqR3l0zTMBsSYCb9gbwHYugfPVxi12RERG9WOf5f8FJzlVinSOFDyxozjVKsnwkBS5H1y5qKs9EMjEGKaMNc0qpyFTpDfNO10nNsb/DEzZRqPyVbKrLFyxrgzdiQpmr6xxSK3MbLurf/PL5O+BpzWIbvoT3iTqQXkMog/OJw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: jbeulich@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Delivery-date: Thu, 13 Nov 2025 01:01:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

struct cpuinfo_x86
  .x86        => .family
  .x86_vendor => .vendor
  .x86_model  => .model
  .x86_mask   => .stepping

No functional change.
---
 xen/arch/x86/cpu/intel.c                | 32 +++++++++++++------------
 xen/arch/x86/include/asm/intel-family.h |  4 ++++
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6f71365b7e..36e4c71802 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -86,7 +86,7 @@ static void __init check_memory_type_self_snoop_errata(void)
        if (!boot_cpu_has(X86_FEATURE_SS))
                return;
 
-       switch (boot_cpu_data.x86_model) {
+       switch (boot_cpu_data.model) {
        case 0x0f: /* Merom */
        case 0x16: /* Merom L */
        case 0x17: /* Penryn */
@@ -137,10 +137,10 @@ static void __init probe_masking_msrs(void)
        unsigned int exp_msr_basic, exp_msr_ext, exp_msr_xsave;
 
        /* Only family 6 supports this feature. */
-       if (c->x86 != 6)
+       if (c->family != 6)
                return;
 
-       switch (c->x86_model) {
+       switch (c->model) {
        case 0x17: /* Yorkfield, Wolfdale, Penryn, Harpertown(DP) */
        case 0x1d: /* Dunnington(MP) */
                msr_basic = MSR_INTEL_MASK_V1_CPUID1;
@@ -191,7 +191,7 @@ static void __init probe_masking_msrs(void)
               expected_levelling_cap, levelling_caps,
               (expected_levelling_cap ^ levelling_caps) & levelling_caps);
        printk(XENLOG_WARNING "Fam %#x, model %#x expected (%#x/%#x/%#x), "
-              "got (%#x/%#x/%#x)\n", c->x86, c->x86_model,
+              "got (%#x/%#x/%#x)\n", c->family, c->model,
               exp_msr_basic, exp_msr_ext, exp_msr_xsave,
               msr_basic, msr_ext, msr_xsave);
        printk(XENLOG_WARNING
@@ -265,7 +265,7 @@ static void __init noinline intel_init_levelling(void)
         * so skip it altogether. In the case where Xen is virtualized these
         * MSRs may be emulated though, so we allow it in that case.
         */
-       if ((boot_cpu_data.x86 != 0xf || cpu_has_hypervisor) &&
+       if ((boot_cpu_data.family != 0xf || cpu_has_hypervisor) &&
            probe_cpuid_faulting()) {
                expected_levelling_cap |= LCAP_faulting;
                levelling_caps |= LCAP_faulting;
@@ -348,7 +348,7 @@ void intel_unlock_cpuid_leaves(struct cpuinfo_x86 *c)
 static void cf_check early_init_intel(struct cpuinfo_x86 *c)
 {
        /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
-       if (c->x86 == 15 && c->x86_cache_alignment == 64)
+       if (c->family == 15 && c->x86_cache_alignment == 64)
                c->x86_cache_alignment = 128;
 
        if (c == &boot_cpu_data &&
@@ -358,8 +358,8 @@ static void cf_check early_init_intel(struct cpuinfo_x86 *c)
        intel_unlock_cpuid_leaves(c);
 
        /* CPUID workaround for Intel 0F33/0F34 CPU */
-       if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
-           (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+       if (boot_cpu_data.vfm == INTEL_P4_PRESCOTT &&
+           (boot_cpu_data.stepping == 3 || boot_cpu_data.stepping == 4))
                paddr_bits = 36;
 
        if (c == &boot_cpu_data) {
@@ -458,7 +458,7 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 {
        uint64_t val;
 
-       if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) {
+       if ( c->vfm == INTEL_P4_WILLAMETTE && c->stepping == 1 ) {
                val = rdmsr(MSR_IA32_MISC_ENABLE);
                if ((val & (1 << 9)) == 0) {
                        printk (KERN_INFO "CPU: C0 stepping P4 Xeon 
detected.\n");
@@ -468,8 +468,10 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
                }
        }
 
-       if (c->x86 == 6 && cpu_has_clflush &&
-           (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
+       if ( cpu_has_clflush &&
+           ( c->vfm == INTEL_CORE2_DUNNINGTON ||
+             c->vfm == INTEL_NEHALEM_EX ||
+             c->vfm == INTEL_WESTMERE_EX ))
                setup_force_cpu_cap(X86_BUG_CLFLUSH_MONITOR);
 
        probe_c3_errata(c);
@@ -540,7 +542,7 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         }
     }
 
-    switch ( c->x86 )
+    switch ( c->family )
     {
         static const unsigned short core_factors[] =
             { 26667, 13333, 20000, 16667, 33333, 10000, 40000 };
@@ -553,7 +555,7 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         if ( !max_ratio )
             return;
 
-        switch ( c->x86_model )
+        switch ( c->model )
         {
         case 0x0e: /* Core */
         case 0x0f: case 0x16: case 0x17: case 0x1d: /* Core2 */
@@ -657,8 +659,8 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
        /* Work around errata */
        Intel_errata_workarounds(c);
 
-       if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
-               (c->x86 == 0x6 && c->x86_model >= 0x0e))
+       if ((c->family == 0xf && c->model >= 0x03) ||
+               (c->family == 0x6 && c->model >= 0x0e))
                __set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
        if (cpu_has(c, X86_FEATURE_ITSC)) {
                __set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
diff --git a/xen/arch/x86/include/asm/intel-family.h 
b/xen/arch/x86/include/asm/intel-family.h
index d8c0bcc406..c71e744731 100644
--- a/xen/arch/x86/include/asm/intel-family.h
+++ b/xen/arch/x86/include/asm/intel-family.h
@@ -179,6 +179,10 @@
 #define INTEL_XEON_PHI_KNL             IFM(6, 0x57) /* Knights Landing */
 #define INTEL_XEON_PHI_KNM             IFM(6, 0x85) /* Knights Mill */
 
+/* Family 15 - NetBurst */
+#define INTEL_P4_WILLAMETTE            IFM(15, 0x01) /* Also Xeon Foster */
+#define INTEL_P4_PRESCOTT              IFM(15, 0x03)
+
 /* Family 5 */
 #define INTEL_FAM5_QUARK_X1000         0x09 /* Quark X1000 SoC */
 #define INTEL_QUARK_X1000              IFM(5, 0x09) /* Quark X1000 SoC */
-- 
2.51.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.