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

[PATCH] x86: Remove x86 prefixed names from cpuinfo for common.c


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Mon, 23 Feb 2026 14:54:58 +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=Tgevt+JNIHEf4sqMGVBsmtuPZIiHU7WMQlfaHHEPSN0=; b=bNmzFhchHg/fjLpYA+Zz1u54sZLdrfFvtQc40zSH6bSKIp4wvHYXGmvQQOLzu3VnuNhr3JtAkdBJLpUMTmecj7n2ksRL6C1kUSgpR9xT9KxgTpTYoVXz/RwRIhQ1CmnZeyRkYe6C1amoRCNfpgjmai4thS8GIZdFoCKTqlrbUuOkHqgXHLFHs8iEqGyqwOG8z2iJ6sCKm2+UOLeHzdU8OdJ3JOKqwlEf9aqkqRsdCeL0AgZial17u2nrkoBi01E/I5ZJ3ytpxrW9E1znL2RIJgPjGCqxuLHts45gYKtWAxh3zrRNGEL+FLv3lSKYiGGJ2tiMVosfbcG88EClpXSSTA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=inl/TyyvKgqb8mcZUeEZycZQSQTvlK3kLwOI9piNqTUsqGXpSh00U8l8b3MnPsSeQLG5q8zZUP8Rdywao0qOYLCr5YC68AHTiUum3Kwd0/XohpX9KRtaiLbfzrR9okx2Thp1RlLEFYjkmZKYFON9wVVDfiIXAgBJ9TKiEACoubdQFjjX3qDiht39bzsp1gIUqJZDAH2YIhVZ7rHOXPM+ShEsCYCvcjePvIJFNAMEHQFSEi0N+Ps+tQXoSV+3xwe2T0M2r7yVyIUVecTxRwMAyOc6uf8j0TW6S1UJ6b3WY9BFjOlJqmru0XaDzrCtrKZXSVL5+kGJTGA8BE51MOJHkg==
  • 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: Mon, 23 Feb 2026 14:54:42 +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.

This work is part of making Xen safe for Intel family 18/19.

Signed-off-by: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
---
 xen/arch/x86/cpu/common.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ebe2baf8b9..bfa63fcfb7 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -327,8 +327,8 @@ void __init early_cpu_init(bool verbose)
        *(u32 *)&c->x86_vendor_id[8] = ecx;
        *(u32 *)&c->x86_vendor_id[4] = edx;
 
-       c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
-       switch (c->x86_vendor) {
+       c->vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
+       switch (c->vendor) {
        case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
                                  actual_cpu = intel_cpu_dev;    break;
        case X86_VENDOR_AMD:      actual_cpu = amd_cpu_dev;      break;
@@ -345,7 +345,7 @@ void __init early_cpu_init(bool verbose)
        }
 
        cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
-       c->x86 = get_cpu_family(eax, &c->x86_model, &c->x86_mask);
+       c->family = get_cpu_family(eax, &c->model, &c->stepping);
 
        edx &= ~cleared_caps[FEATURESET_1d];
        ecx &= ~cleared_caps[FEATURESET_1c];
@@ -389,8 +389,8 @@ void __init early_cpu_init(bool verbose)
                printk(XENLOG_INFO
                       "CPU Vendor: %s, Family %u (%#x), "
                       "Model %u (%#x), Stepping %u (raw %08x)\n",
-                      x86_cpuid_vendor_to_str(c->x86_vendor), c->x86,
-                      c->x86, c->x86_model, c->x86_model, c->x86_mask,
+                      x86_cpuid_vendor_to_str(c->vendor), c->family,
+                      c->family, c->model, c->model, c->stepping,
                       eax);
 
        if (c->cpuid_level >= 7) {
@@ -432,7 +432,7 @@ void __init early_cpu_init(bool verbose)
                paddr_bits -= (ebx >> 6) & 0x3f;
        }
 
-       if (!(c->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
+       if (!(c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
                park_offline_cpus = opt_mce;
 
        initialize_cpu_data(0);
@@ -442,10 +442,10 @@ void reset_cpuinfo(struct cpuinfo_x86 *c, bool keep_basic)
 {
     if ( !keep_basic )
     {
-        c->x86_vendor = 0;
-        c->x86 = 0;
-        c->x86_model = 0;
-        c->x86_mask = 0;
+        c->vendor = 0;
+        c->family = 0;
+        c->model = 0;
+        c->stepping = 0;
         memset(&c->x86_capability, 0, sizeof(c->x86_capability));
         memset(&c->x86_vendor_id, 0, sizeof(c->x86_vendor_id));
         memset(&c->x86_model_id, 0, sizeof(c->x86_model_id));
@@ -465,18 +465,18 @@ static void generic_identify(struct cpuinfo_x86 *c)
        *(u32 *)&c->x86_vendor_id[8] = ecx;
        *(u32 *)&c->x86_vendor_id[4] = edx;
 
-       c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
-       if (boot_cpu_data.x86_vendor != c->x86_vendor)
+       c->vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
+       if (boot_cpu_data.vendor != c->vendor)
                printk(XENLOG_ERR "CPU%u vendor %u mismatch against BSP %u\n",
-                      smp_processor_id(), c->x86_vendor,
-                      boot_cpu_data.x86_vendor);
+                      smp_processor_id(), c->vendor,
+                      boot_cpu_data.vendor);
 
        /* Initialize the standard set of capabilities */
        /* Note that the vendor-specific code below might override */
 
        /* Model and family information. */
        cpuid(1, &eax, &ebx, &ecx, &edx);
-       c->x86 = get_cpu_family(eax, &c->x86_model, &c->x86_mask);
+       c->family = get_cpu_family(eax, &c->model, &c->stepping);
        c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
        c->phys_proc_id = c->apicid;
 
@@ -605,7 +605,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
        if ( !c->x86_model_id[0] ) {
                /* Last resort... */
                snprintf(c->x86_model_id, sizeof(c->x86_model_id),
-                       "%02x/%02x", c->x86_vendor, c->x86_model);
+                       "%02x/%02x", c->vendor, c->model);
        }
 
        /* Now the feature flags better reflect actual CPU features! */
@@ -824,16 +824,16 @@ void print_cpu_info(unsigned int cpu)
 
        printk("CPU%u: ", cpu);
 
-       vendor = x86_cpuid_vendor_to_str(c->x86_vendor);
+       vendor = x86_cpuid_vendor_to_str(c->vendor);
        if (strncmp(c->x86_model_id, vendor, strlen(vendor)))
                printk("%s ", vendor);
 
        if (!c->x86_model_id[0])
-               printk("%d86", c->x86);
+               printk("%d86", c->family);
        else
                printk("%s", c->x86_model_id);
 
-       printk(" stepping %02x\n", c->x86_mask);
+       printk(" stepping %02x\n", c->stepping);
 }
 
 static cpumask_t cpu_initialized;
-- 
2.51.1




 


Rackspace

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