From nobody Fri Apr 26 12:03:04 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557159216; cv=none; d=zoho.com; s=zohoarc; b=bhUmzsuYGo6ypGgfQ3qRM9KMFVfNjOrHYlN3DkeASk39t2bAiTdwE/9v14j/RSv1bexRv1pVa7OgMsbI7vX+fT+OMR8oA1DIfuQZep9MyVhimm62RmZcBlsHMEahcS8V2eP9s9okVj+BZmslnw4GSKWsWwI//CPdA1T0SEMtXK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557159216; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=+Ylim1XMbpAamOf+3hMsjOaeBo2vrq5MaLcwHoIbRwk=; b=AEhxZF6fKpSY3HOjZtkauzdNrxQzcj1GXXtgVaYcdQEW8s2zEU56LO59P7B5NymCo3AoAyTdmcTHVuQVSZvimhQbioxuyGuGRgYyeOE+Xoohirv0U7DptFmzNdLPr5S4eVS71dQH/refSe0zt2PdvAp6Sr8UDjh+KHyiqOdqbCk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15571592162511012.0779485751343; Mon, 6 May 2019 09:13:36 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hNgDZ-0004K9-3i; Mon, 06 May 2019 16:11:53 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hNgDX-0004K4-EH for xen-devel@lists.xenproject.org; Mon, 06 May 2019 16:11:51 +0000 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a714df87-7019-11e9-843c-bc764e045a96; Mon, 06 May 2019 16:11:49 +0000 (UTC) X-Inumbo-ID: a714df87-7019-11e9-843c-bc764e045a96 X-IronPort-AV: E=Sophos;i="5.60,438,1549929600"; d="scan'208";a="85174582" From: Andrew Cooper To: Xen-devel Date: Mon, 6 May 2019 17:11:46 +0100 Message-ID: <1557159106-32381-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/boot: Print the CPU model string alongside the Family/Model/Stepping info X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is also useful information when looking at boot logs. To do this, reuse get_model_name() which requires c->extended_cpuid_level to be calculated. early_cpu_init() already opencodes the calculation, so set c->extended_cpuid_level directly. While playing in this area, clean up get_model_name(). Its use in generic_identify() makes the sole external call from the Centaur code redundant. Make it local and switch to using a boolean return value. As sample boot now looks like: (XEN) CPU Vendor: Intel, Family 6 (0x6), Model 60 (0x3c), Stepping 3 (raw= 000306c3) (XEN) CPU Model: Intel(R) Xeon(R) CPU E3-1240 v3 @ 3.40GHz Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/cpu/centaur.c | 1 - xen/arch/x86/cpu/common.c | 15 ++++++++++----- xen/arch/x86/cpu/cpu.h | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c index 34a5bfc..0e634a1 100644 --- a/xen/arch/x86/cpu/centaur.c +++ b/xen/arch/x86/cpu/centaur.c @@ -44,7 +44,6 @@ static void init_c3(struct cpuinfo_x86 *c) __set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); } =20 - get_model_name(c); display_cacheinfo(c); } =20 diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c index fa8548e..12172aa 100644 --- a/xen/arch/x86/cpu/common.c +++ b/xen/arch/x86/cpu/common.c @@ -188,13 +188,13 @@ void ctxt_switch_levelling(const struct vcpu *next) bool_t opt_cpu_info; boolean_param("cpuinfo", opt_cpu_info); =20 -int get_model_name(struct cpuinfo_x86 *c) +static bool get_model_name(struct cpuinfo_x86 *c) { unsigned int *v; char *p, *q; =20 if (c->extended_cpuid_level < 0x80000004) - return 0; + return false; =20 v =3D (unsigned int *) c->x86_model_id; cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]); @@ -214,7 +214,7 @@ int get_model_name(struct cpuinfo_x86 *c) *q++ =3D '\0'; /* Zero-pad the rest */ } =20 - return 1; + return true; } =20 =20 @@ -303,13 +303,18 @@ void __init early_cpu_init(void) c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] =3D edx; c->x86_capability[cpufeat_word(X86_FEATURE_SSE3)] =3D ecx; =20 + c->extended_cpuid_level =3D cpuid_eax(0x80000000); + if ((c->extended_cpuid_level >> 16) !=3D 0x8000) + c->extended_cpuid_level =3D 0; + 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, eax); + if (get_model_name(c)) + printk(XENLOG_INFO "CPU Model: %.48s\n", c->x86_model_id); =20 - eax =3D cpuid_eax(0x80000000); - if ((eax >> 16) =3D=3D 0x8000 && eax >=3D 0x80000008) { + if (c->extended_cpuid_level >=3D 0x80000008) { eax =3D cpuid_eax(0x80000008); paddr_bits =3D eax & 0xff; if (paddr_bits > PADDR_BITS) diff --git a/xen/arch/x86/cpu/cpu.h b/xen/arch/x86/cpu/cpu.h index 54bd0d3..d30f42b 100644 --- a/xen/arch/x86/cpu/cpu.h +++ b/xen/arch/x86/cpu/cpu.h @@ -12,5 +12,4 @@ extern unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_ed= x; extern unsigned int opt_cpuid_mask_xsave_eax; extern unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx; =20 -extern int get_model_name(struct cpuinfo_x86 *c); extern void display_cacheinfo(struct cpuinfo_x86 *c); --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel