[Public] Hi,
> -----Original Message----- > From: Jan Beulich <[email protected]> > Sent: Monday, March 24, 2025 10:28 PM > To: Penny, Zheng <[email protected]> > Cc: Huang, Ray <[email protected]>; Andrew Cooper > <[email protected]>; Roger Pau Monné <[email protected]>; > Anthony PERARD <[email protected]>; Orzel, Michal > <[email protected]>; Julien Grall <[email protected]>; Stefano Stabellini > <[email protected]>; [email protected] > Subject: Re: [PATCH v3 02/15] xen/x86: introduce new sub-hypercall to > propagate > CPPC data > > On 06.03.2025 09:39, Penny Zheng wrote: > > + pm_info = processor_pminfo[cpuid]; > > + /* Must already allocated in set_psd_pminfo */ > > + if ( !pm_info ) > > + { > > + ret = -EINVAL; > > + goto out; > > + } > > + pm_info->cppc_data = *cppc_data; > > + > > + if ( cpufreq_verbose ) > > + print_CPPC(&pm_info->cppc_data); > > + > > + pm_info->init = XEN_CPPC_INIT; > > That is - whichever Dom0 invoked last will have data recorded, and the other > effectively is discarded? I think a warning (perhaps a one-time one) is > minimally > needed to diagnose the case where one type of data replaces the other. > In last v2 discussion, we are discussing that either set_px_pminfo or set_cppc_pminfo shall be invoked, which means either PX data is recorded, or CPPC data is recorded. Current logic is that, cpufreq cmdline logic will set the XEN_PROCESSOR_PM_PX/CPPC flag to reflect user preference, if user defines the fallback option, like "cpufreq=amd-cppc,xen", we will have both XEN_PROCESSOR_PM_PX | XEN_PROCESSOR_PM_CPPC set in the beginning. Later in cpufreq driver register logic, as only one register could be registered , if amd-cppc being registered successfully, it will clear the XEN_PROCESSOR_PM_PX flag bit. But if it fails to register, fallback scheme kicks off, we will try the legacy P-states, in the mean time, clearing the XEN_PROCESSOR_PM_CPPC. We are trying to make XEN_PROCESSOR_PM_PX and XEN_PROCESSOR_PM_CPPC exclusive values after driver registration, which will ensure us that either set_px_pminfo or set_cppc_pminfo is taken in the runtime. > With this it also remains unclear to me how fallback to the legacy driver is > intended > to be working. Both taken together are a strong suggestion that important > information on the model that is being implemented is missing from the > description. > > > @@ -27,8 +28,6 @@ struct processor_performance { > > struct xen_pct_register status_register; > > uint32_t state_count; > > struct xen_processor_px *states; > > - > > - uint32_t init; > > }; > > > > struct processor_pminfo { > > @@ -37,6 +36,9 @@ struct processor_pminfo { > > struct xen_psd_package domain_info; > > uint32_t shared_type; > > struct processor_performance perf; > > + struct xen_processor_cppc cppc_data; > > + > > + uint32_t init; > > }; > > This moving of the "init" field and the mechanical changes coming with it can > likely > be split out to a separate patch? Provided of course the movement is still > wanted/needed with patch 1 re-worked or dropped. > > Jan
