[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] x86/Intel: also display CPU freq for family 0xf
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 11 Feb 2022 11:22:30 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=M2z+UpBgPwg5bYg5mejRY+EeYHpt04WkYh5f3MMfUuo=; b=Y3XAtTu5NAQj7L4PveuChsY2d0RuIsKrS8WBa+H7dhXHES9qa65GRgOf3kiOQjCO3YtK8zemPIF+F2PjEGpfnWzH6/eNb1TT7ph+lAZsUftyB5dpr03F0c0jHT9LFT0EohZ0PSc3ix9PV86Rp0fX9v9kDwmT7Z23lE89XagNDhrc0rCeRgp4kd99XVJlIHfH8MPP1/sQKgw3CkUUx7Kpef+P4JEdEMnEMHxhOGpY85L9b9SMPxdOo9wA2hv8xhm6fpRGa+wIxocRPIn91essPx7Xk0ndItjdyB4Y+BhklLHUmPAaEGQP8bkDZkjyfC6qMoQCdc+I5a32aaggF3Zprw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BGAoW8aepAI8t45cibvzsVa4OB0EvZVUYWadpDkikcWPxsL/xkkGPWWNF1Wdu/Gu8C4vKbjJFVhjnfmcIWmjIPfa6zJ2q1f11QJ2RqIHUtwWiEXvBKTtAvCdwwvlR0+eKDURLNBu5QLlYys51NYccuGaTbt0Kd/UwHFNbwfMpJPHTtSFTcpdUaTHUUv2XmStn7JS3H759MzQdQMISI4PBdghy9nJF7ZnIQvtHOr1mnJE9Zj9g07ZGsZFYWWp3Wyt16AWS85VPHfdpH+TtW3E1nIi3OS5ujpqyPntjOTu02mwePWLVxTZ6mv6wLMazlXknxeGzL7CMXh/i/CdirPGwA==
- Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Fri, 11 Feb 2022 10:22:51 +0000
- Ironport-data: A9a23:HSoFmaI+e518GLM3FE+RA5IlxSXFcZb7ZxGr2PjKsXjdYENShTQCx 2FLUWrUP/yDNDD3f98gPY20o0IDuJ6Hm4dmTFBlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUakideSc+EH170Ug6wrZg6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB223PRek 5Z9paaVclcKO7DyqbQkUklhRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsF2gcsuNo/zNZ43sXB81zDJS/0hRPgvRo2Uvo4AjGdv26iiG97Dd eRDSQVASC3HOUxxYmcTCKh9msmB0yyXnzpw9wvO+PtfD3Lo5BN1+KjgNpzSYNPibdVYmAOUq 3zL+0z9AwoGL5qPxDyd6HWui+TT2yThV+o6Fre16/pri1273XEIBVsdUl7TnBWiohfgAZQFc RVSo3dw6/hpnKC2cjXjdyL7hFHf/S4MYf9rQ84/9T+8mpPVsz/MUwDoUQV9QNAhscY3Qxkj2 VmIg87lCFRTjVGFdZ6O3uzK9G3vYED5OUdHPHZZFl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v93i0MFuelwixC3VoO/w/utrDf iF28v7ip5wRqR+1g1oIKpPQRJvWdpXLsyxiJYQxVXNMTAGKZNeDDFJHgGa5fKIHCR4gvFm8mGk KPxpYOW8tc53xhQnZ79VJShQsqZD6QDJvscFNyNCIQT5c3ydzG2f4kMPwEGlD5sj1kVICyoOrU 4WGt/UyKCLNwkKm1yqp55acaTzS/+0Rfj5/ug7BTD0h6vHEBG3xjBrOBsqpEvmVixHutezaPts p2+HEHNQmpWFrX7oWywG02vr
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Feb 10, 2022 at 03:56:48PM +0100, Jan Beulich wrote:
> Actually we can do better than simply bailing for there not being any
> PLATFORM_INFO MSR on these. The "max" part of the information is
> available in another MSR, alongside the scaling factor (which is
> encoded in similar ways to Core/Core2, and hence the decoding table can
> be shared).
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
> The inner switch() is left indented one level too much (and with an
> extra pair of braces) to limit the diff. I'd prefer to make a follow-up
> patch reducing the indentation, unless I'm told to do so right here.
I'm fine with a followup patch.
> --- a/xen/arch/x86/cpu/intel.c
> +++ b/xen/arch/x86/cpu/intel.c
> @@ -412,9 +412,9 @@ static int num_cpu_cores(struct cpuinfo_
>
> static void intel_log_freq(const struct cpuinfo_x86 *c)
> {
> - unsigned int eax, ebx, ecx, edx;
> + unsigned int eax, ebx, ecx, edx, factor;
> uint64_t msrval;
> - uint8_t max_ratio;
> + uint8_t max_ratio, min_ratio;
>
> if ( c->cpuid_level >= 0x15 )
> {
> @@ -455,21 +455,22 @@ static void intel_log_freq(const struct
> }
> }
>
> - if ( c->x86 == 0xf || rdmsr_safe(MSR_INTEL_PLATFORM_INFO, msrval) )
> - return;
> - max_ratio = msrval >> 8;
> -
> - if ( max_ratio )
> + switch ( c->x86 )
> {
> - unsigned int factor = 10000;
> - uint8_t min_ratio = msrval >> 40;
> + static const unsigned short core_factors[] =
This no longer applies to Core models only, so I wouldn't be opposed
to renaming to scaling_factors or similar.
Thanks, Roger.
|