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

RE: [PATCH v4 03/15] xen/x86: introduce new sub-hypercall to propagate CPPC data


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Tue, 6 May 2025 09:56:22 +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=7Fi5YFBTDWu0nQZVLY0j6+CDbFegIRkOkjS6nhye0l4=; b=m++KuVn9Khlf+XKGrap4hfMohQQPcOyRJM8o46cM6Szy+lUhK7SyWrTeSTnXbaU6As9k2WTXKRKMtARydSnZdyMkh/KJhRu4i2NfMsfZnLxS92HQtPaDx5dfRzUOW/o03Jmb+aeNoMgKwig85GCkszGReEN/Py5rSNPzw2x2X3nsVBxPkXYSBSxhrpTuWEMQJzag5k5FnK6MGovWZ2hJotHXPVTL9jfXWOYIJkJJt0SJae1T/GqJ6krSB6FtNPJlRSq8LCaThWqcV0b5gotd+zlf9lsPzhsNDvxOV0TblBE7aPW+obRD0Wcuz/4lJCQzBsGbEevXI4U3vTJM8I0/3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vgcvY07ZggBUfXt6J9M9eiRrh6oEKdEmxfWcyxfGW4DThIPHXZCSH6nawrHYma1GbJKXfzLT0/j52x0c9IuFFs8R+GuIfy04XHvd7LkaXrlTLA5T4z8XnG3hWO/EgdksIXPjBAPcBJOh445BWIQSgA6KchehWENCYoq6FRfycZ67VL0nA0J0l8tc2p0dTsFQ6UidYhoprmnT6/SQQusLGOsX46FetWpEZ64RNecuqgM8pMHExYCCZa/O/CB05ODHskRwSYDWbdMPP45oFYhMgykvo3TWvHiq1OQ+h72JaYFZvfxVH2nGWmb5wRd+/FJU2tgsl0yP6kvwAUBqjvKKSA==
  • 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>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 06 May 2025 09:56:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=c756dc54-ffb3-4a2e-9c0a-fd4cc4d57b01;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-05-06T09:56:14Z;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: AQHbrRCmWPNHyarMuUaK4nZ2TXIaALO5UliAgAwsfxA=
  • Thread-topic: [PATCH v4 03/15] xen/x86: introduce new sub-hypercall to propagate CPPC data

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, April 28, 2025 11:57 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>;
> Anthony PERARD <anthony.perard@xxxxxxxxxx>; Orzel, Michal
> <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 03/15] xen/x86: introduce new sub-hypercall to 
> propagate
> CPPC data
>
> On 14.04.2025 09:40, Penny Zheng wrote:
> > @@ -459,6 +464,26 @@ struct xen_processor_performance {  typedef
> > struct xen_processor_performance xen_processor_performance_t;
> > DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
> >
> > +struct xen_processor_cppc {
> > +    uint8_t flags; /* flag for CPPC sub info type */
> > +    /*
> > +     * Subset _CPC fields useful for CPPC-compatible cpufreq
> > +     * driver's initialization
> > +     */
> > +    struct {
> > +        uint32_t highest_perf;
> > +        uint32_t nominal_perf;
> > +        uint32_t lowest_nonlinear_perf;
> > +        uint32_t lowest_perf;
> > +        uint32_t lowest_mhz;
> > +        uint32_t nominal_mhz;
> > +    } cpc;
> > +    struct xen_psd_package domain_info; /* _PSD */
>
> This being a member of the new type, ...
>
> > --- a/xen/include/xlat.lst
> > +++ b/xen/include/xlat.lst
> > @@ -168,6 +168,7 @@
> >  !  processor_performance           platform.h
> >  !  processor_power                 platform.h
> >  ?  processor_px                    platform.h
> > +?  processor_cppc                  platform.h
>
> ... how can it be ? here when it's ...
>
> >  !  psd_package                     platform.h
>
> ... ! here? And with it being ?, you're lacking a place where you invoke the 
> resulting
> checking macro (which I assume would cause a build failure).
>
> Also when laying out struct xen_processor_cppc, please avoid unnecessary gaps
> or tail padding - it looks like "shared_type" would better move up. I think 
> it would
> also be a good idea to make padding fields explicit, and check them to be 
> zero.
> This way they can be assigned meaning later (if need
> be) without breaking backwards compatibility.
>

Understood, I'll re-construct into increasing order and add explicit padding:
```
struct xen_processor_cppc {
    uint8_t flags; /* flag for CPPC sub info type */
    uint8_t pad[3]; /* padding and must be zero */
    /*
     * Subset _CPC fields useful for CPPC-compatible cpufreq
     * driver's initialization
     */
    struct {
        uint32_t highest_perf;
        uint32_t nominal_perf;
        uint32_t lowest_nonlinear_perf;
        uint32_t lowest_perf;
        uint32_t lowest_mhz;
        uint32_t nominal_mhz;
    } cpc;
    /* Coordination type of this processor */
    uint32_t shared_type;
    struct xen_psd_package domain_info; /* _PSD */
};
```
> Jan

 


Rackspace

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