On 11.07.2025 05:51, Penny Zheng wrote: > --- a/xen/drivers/cpufreq/cpufreq.c > +++ b/xen/drivers/cpufreq/cpufreq.c > @@ -968,3 +968,9 @@ bool cpufreq_in_cppc_passive_mode(unsigned int cpuid) > return processor_pminfo[cpuid]->init & XEN_CPPC_INIT && > cpufreq_driver.target; > } > + > +bool cpufreq_is_governorless(unsigned int cpuid) > +{ > + return processor_pminfo[cpuid]->init && (hwp_active() || > + cpufreq_driver.setpolicy); > +}
The function, by its name, is seemingly generic, yet its implementation is tailored to the HWP and CPPC drivers. I think such needs calling out in a comment. Seeing the XEN_CPPC_INIT check in context, I also wonder why here you check for ->init just being non-zero. Jan