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

RE: [PATCH v3 08/15] xen/amd: export processor max frequency value


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Thu, 27 Mar 2025 08:38:32 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=2OjmTYNs557635oxZPdCs35UjNF0TopRJS8eUAOJ/vk=; b=lkBdsMMMYLgFgsYeK1+Kr2kBxEfCcwLRlGEeHlB24YTi/PU7H7iAlAebbilX1iznWAirr1ZpNcwd8WDmuotAQrV1Bd9MtnipMtidBFUe0kH6KGFNq0HaQQ7Tw4uMl2Hxbfdtu0nzvHwrzN7lEM1YqhzNhKyr3Mk7yFpQzdwt4xkIS7NCDeDZAuphPDhamIOAWGcu3vvR/iPEMYa3X1sLWQzEKutVby0joECx8IhH+/RB9IkuoNj0LBG7rrME4Ytk9rdOW6Lc02WwZPRqvm8hGeRxXR13OAybJHgpMm8f+2kKRHEsNl6jy9VzVThKawBlwOhZA5hl4eN0e4umNZXINw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bSulkwmuRsmf3Y0pRE/mrLPA6483hY2bzpUngYc36oMRPQa3m/WrDy6LXxPsio1u66tFyfFVm4uG48e6Z9SW1Ln4idbLLq2DwLmAuBLELm3NM28P+tcfqXcrSqavSn4rjadbyKtxeR5loKKi6sq8QROQmPT6OMnEhhMBlPzLKm1uoQRUHwt8Cllh+WjegXkWIc4kBfi3v+p97kNnP7g/z6Of6cyhUglun+tSgXlvzOPD5f5ucm7o2SvMRirZhDqbha6IcY7rNsFBdrv3WHywj+PyVAxrRAOyechpLQAJ4fDVyTDOX0Ve4FCkthUaEX+EYcrFQDT7Fff42r7AQGoBBw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 27 Mar 2025 08:38:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=e9349405-6eef-4a50-b5c7-12a707e5908e;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=0;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=true;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-03-27T08:38:26Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Tag=10, 0, 1, 1;
  • Thread-index: AQHbjnNvhCrdHHKqk0qGbgQkaC8i17OCjH4AgAQ8V7A=
  • Thread-topic: [PATCH v3 08/15] xen/amd: export processor max frequency value

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, March 24, 2025 11:52 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 08/15] xen/amd: export processor max frequency value
>
> On 06.03.2025 09:39, Penny Zheng wrote:
> > --- a/xen/arch/x86/cpu/amd.c
> > +++ b/xen/arch/x86/cpu/amd.c
> > @@ -56,6 +56,8 @@ bool __initdata amd_virt_spec_ctrl;
> >
> >  static bool __read_mostly fam17_c6_disabled;
> >
> > +DEFINE_PER_CPU_READ_MOSTLY(uint64_t, amd_max_freq_mhz);
> > +
> >  static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
> >                              unsigned int *hi)
> >  {
> > @@ -681,9 +683,15 @@ void amd_log_freq(const struct cpuinfo_x86 *c)
> >             printk("CPU%u: %lu ... %lu MHz\n",
> >                    smp_processor_id(),
> >                    amd_parse_freq(c, lo), amd_parse_freq(c, hi));
> > -   else
> > +   else {
> >             printk("CPU%u: %lu MHz\n", smp_processor_id(),
> >                    amd_parse_freq(c, lo));
> > +           return;
> > +   }
> > +
> > +   /* Store max frequency for amd-cppc cpufreq driver */
> > +   if (hi >> 63)
> > +           this_cpu(amd_max_freq_mhz) = amd_parse_freq(c, hi);
> >  }
>
> As before - typically only the BSP will make it here, due to the conditional 
> at the top
> of the function. IOW you'll observe zeros in the per-CPU data for all other 
> CPUs.
>

I'll extract the processing frequency logic into a new helper, maybe 
amd_process_freq()

> > --- a/xen/arch/x86/include/asm/amd.h
> > +++ b/xen/arch/x86/include/asm/amd.h
> > @@ -174,4 +174,5 @@ bool amd_setup_legacy_ssbd(void);  void
> > amd_set_legacy_ssbd(bool enable);  void amd_set_cpuid_user_dis(bool
> > enable);
> >
> > +DECLARE_PER_CPU(uint64_t, amd_max_freq_mhz);
> >  #endif /* __AMD_H__ */
>
> I'm also pretty sure that I did ask before to maintain a blank line ahead of 
> the
> #endif. Please may I ask that you thoroughly address earlier review comments,
> before submitting a new version?
>

Sorry, I'll be more careful.

> Jan

 


Rackspace

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