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

[PATCH] x86: minor tidying of identify_cpu()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 13 Jun 2023 08:12:40 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=EmI1MheBS/083LswXZTMMBBl1EIZuDCFRIBCVvHzQlw=; b=P+Ahk9f2Sz6Jb8ugpRZle2SqSoRzqRjW6L7cS/61FkjAPNcyF/xxPKBCJaQQBJJavHT7ZPlIV6Y37OwImq1tdyktTShNRu4j6nUsgUQFBSnZXlTOE8/FhTyOKUcGfuDCr6c2W0VKqlVwFyK/7OPPDzk+B5TEgC90hQu8pGjyQQge+/Klag6lF660pngfeFLNQym1dmgXprIlXmkFmyN4+bAb3E6QVgzdo9oqFT2X4eA51lRWB4V4ZcEC9HXsHDX7z5riOxOw/MCcO4vWl5xoa2H99dLRHrWg28OKP19cN1iKFw9UhOIMTfTN/ARmK6Ygp2SckphrMMTqzQmah3eryw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ArfQFXdnb2+bjiawcT+8PXGeDrQEalFxNGFSm+nEklFHCb1U7ogi6Ll4/nUZk49noFZQhgw7/u4Sq6Qn4B0isH9HmeV0m68EFM0PvEsvhPmCch3U33k36zXgT6xrSJ9ZAWuC6hnloRFLoQ8cNqun/nhQtiF1GjHWISapECsB+jbVNcWZNR/TPxDwyoHt7jNrHNSDGaE5Zw+aWHIWN+1sT3Cfr1okaHOuWr6NaLpyu5YeJTZ48IbP7+GIjo8f5eefoc9RrtZ/ynxcuWt2mNVkIiq6JP7ilDK+ql1cvYaHfADwN99u0HjoD846EmccahOHfweMC1PMTmFGifPFwfja7g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 13 Jun 2023 06:12:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Fields that generic_identify() sets unconditionally don't need pre-
setting. (In fact the compiler removes some of those assignments anyway,
at least in release builds.)

With the setting of ->cpuid_level to -1 gone, also drop the respective
BUG_ON() from default_init().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -114,8 +114,6 @@ bool __init is_forced_cpu_cap(unsigned i
 static void cf_check default_init(struct cpuinfo_x86 * c)
 {
        /* Not much we can do here... */
-       /* Check if at least it has cpuid */
-       BUG_ON(c->cpuid_level == -1);
        __clear_bit(X86_FEATURE_SEP, c->x86_capability);
 }
 
@@ -492,15 +490,11 @@ void identify_cpu(struct cpuinfo_x86 *c)
        int i;
 
        c->x86_cache_size = -1;
-       c->x86_vendor = X86_VENDOR_UNKNOWN;
-       c->cpuid_level = -1;    /* CPUID not detected */
        c->x86_model = c->x86_mask = 0; /* So far unknown... */
-       c->x86_vendor_id[0] = '\0'; /* Unset */
        c->x86_model_id[0] = '\0';  /* Unset */
        c->x86_max_cores = 1;
        c->x86_num_siblings = 1;
        c->x86_clflush_size = 0;
-       c->phys_proc_id = XEN_INVALID_SOCKET_ID;
        c->cpu_core_id = XEN_INVALID_CORE_ID;
        c->compute_unit_id = INVALID_CUID;
        memset(&c->x86_capability, 0, sizeof c->x86_capability);



 


Rackspace

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