[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeul...@suse.com>
> Sent: Monday, April 28, 2025 11:32 PM
> To: Penny, Zheng <penny.zh...@amd.com>
> Cc: Huang, Ray <ray.hu...@amd.com>; Andrew Cooper
> <andrew.coop...@citrix.com>; Anthony PERARD <anthony.per...@vates.tech>;
> Orzel, Michal <michal.or...@amd.com>; Julien Grall <jul...@xen.org>; Roger
> Pau Monné <roger....@citrix.com>; Stefano Stabellini <sstabell...@kernel.org>;
> xen-devel@lists.xenproject.org
> Subject: Re: [PATCH v4 02/15] xen/cpufreq: extract _PSD info from "struct
> xen_processor_performance"
>
> On 14.04.2025 09:40, Penny Zheng wrote:
> > --- a/xen/drivers/cpufreq/cpufreq.c
> > +++ b/xen/drivers/cpufreq/cpufreq.c
> > +    {
> > +    case XEN_PX_INIT:
> > +        if ( shared_type )
> > +            *shared_type = processor_pminfo[cpu]->perf.shared_type;
> > +        if ( domain_info )
> > +            *domain_info = processor_pminfo[cpu]->perf.domain_info;
>
> Does this need to be a structure copy? Can't you hand back just a pointer, 
> with the
> function parameter being const struct xen_psd_package **?
>

I've considered handing backing a pointer, then maybe we need to allocate space 
for
"struct xen_psd_package **domain_info = xvzalloc(struct xen_psd_package *);", 
and XVFREE(xxx)
it in each exit, especially cpufreq_add_cpu() has a lot exits, which could be a 
few code churn.
So I chose the struct copy to have the smallest change.

> > +        break;
> > +    default:
> Jan

Reply via email to