[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 02/15] xen/x86: introduce new sub-hypercall to propagate CPPC data
On 06.03.2025 09:39, Penny Zheng wrote: > In order to provide backward compatibility with existing governors > that represent performance as frequencies, like ondemand, the _CPC > table can optionally provide processor frequency range values, Lowest > frequency and Norminal frequency, to let OS use Lowest Frequency/ > Performance and Nominal Frequency/Performance as anchor points to > create linear mapping of CPPC abstract performance to CPU frequency. > > As Xen is uncapable of parsing the ACPI dynamic table, this commit > introduces a new sub-hypercall to propagate required CPPC data from > dom0 kernel. Nit: Here and ... > If the platform supports CPPC, the _CPC object must exist under all > processor objects. That is, Xen is not expected to support mixed mode > (CPPC & legacy PSS, _PCT, _PPC) operation, either advanced CPPC, or legacy > P-states. > > This commit also introduces a new flag XEN_PM_CPPC to reflect processor > initialised in CPPC mode. ... here and elsewhere: Please avoid "this commit", "this patch", or anything alike in patch descriptions. Apart from this I'm not sure how useful review here is going to be, as there apparently is a dependency on the problematic aspect in patch 1. Therefore I'll give only a few independent comments. > @@ -606,6 +616,41 @@ int set_psd_pminfo(uint32_t acpi_id, uint32_t > shared_type, > return ret; > } > > +int set_cppc_pminfo(uint32_t acpi_id, > + const struct xen_processor_cppc *cppc_data) > +{ > + int ret = 0, cpuid; > + struct processor_pminfo *pm_info; > + > + cpuid = get_cpu_id(acpi_id); > + if ( cpuid < 0 || !cppc_data ) > + { > + ret = -EINVAL; > + goto out; > + } > + if ( cpufreq_verbose ) > + printk("Set CPU acpi_id(%d) cpuid(%d) CPPC State info:\n", > + acpi_id, cpuid); Nit: %d isn't appropriate for a variable/parameter of type uint32_t. In turn I don't think the parameter needs to be of a fixed-width type; unsigned int will be quite fine there, I expect. See ./CODING_STYLE. > + 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. 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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |