xen/cpufreq: move "init" flag into common structure

AMD cpufreq cores will be intialized in two modes, legacy P-state mode,
and CPPC mode. So "init" flag shall be extracted from px-specific
"struct xen_processor_perf", and placed in the common
"struct processor_pminfo". Otherwise, later when introducing a new
sub-hypercall to propagate CPPC data, we need to pass irrelevant px-specific
"struct xen_processor_perf" to just set init flag.

Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Penny Zheng authored and Jan Beulich committed 2025-06-18 09:23:33 +02:00
1 parent d3d36bb494
commit c78c1fd879
3 files changed
+8 -8

No files matched your search

+2 -2
View File
@@ -237,7 +237,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
return -ENODEV;
if ( hwp_active() )
return -EOPNOTSUPP;
if ( !pmpt || !(pmpt->perf.init & XEN_PX_INIT) )
if ( !pmpt || !(pmpt->init & XEN_PX_INIT) )
return -EINVAL;
break;
default:
@@ -635,7 +635,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
case CPUFREQ_PARA:
if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) )
return -ENODEV;
if ( !pmpt || !(pmpt->perf.init & XEN_PX_INIT) )
if ( !pmpt || !(pmpt->init & XEN_PX_INIT) )
return -EINVAL;
break;
}
+4 -4
View File
@@ -209,7 +209,7 @@ int cpufreq_add_cpu(unsigned int cpu)
perf = &processor_pminfo[cpu]->perf;
if ( !(perf->init & XEN_PX_INIT) )
if ( !(processor_pminfo[cpu]->init & XEN_PX_INIT) )
return -EINVAL;
if (!cpufreq_driver.init)
@@ -373,7 +373,7 @@ int cpufreq_del_cpu(unsigned int cpu)
perf = &processor_pminfo[cpu]->perf;
if ( !(perf->init & XEN_PX_INIT) )
if ( !(processor_pminfo[cpu]->init & XEN_PX_INIT) )
return -EINVAL;
if (!per_cpu(cpufreq_cpu_policy, cpu))
@@ -570,7 +570,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf)
if ( cpufreq_verbose )
print_PPC(pxpt->platform_limit);
if ( pxpt->init == XEN_PX_INIT )
if ( pmpt->init == XEN_PX_INIT )
{
ret = cpufreq_limit_change(cpu);
goto out;
@@ -579,7 +579,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf)
if ( perf->flags == ( XEN_PX_PCT | XEN_PX_PSS | XEN_PX_PSD | XEN_PX_PPC ) )
{
pxpt->init = XEN_PX_INIT;
pmpt->init = XEN_PX_INIT;
ret = cpufreq_cpu_init(cpu);
goto out;
+2 -2
View File
@@ -27,14 +27,14 @@ struct processor_performance {
struct xen_processor_px *states;
struct xen_psd_package domain_info;
uint32_t shared_type;
uint32_t init;
};
struct processor_pminfo {
uint32_t acpi_id;
uint32_t id;
struct processor_performance perf;
uint32_t init;
};
extern struct processor_pminfo *processor_pminfo[NR_CPUS];
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.