@@ -499,7 +499,8 @@ If set, force use of the performance counters for oprofile, rather than detectin
available support.
### cpufreq
-> `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]] | amd-pstate[:[verbose]]`
+> `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] }
+[,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]] | amd-pstate[:[active][,verbose]]`
> Default: `xen`
@@ -522,6 +523,12 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
on supported AMD hardware to provide a finer grained frequency control mechanism.
The default is disabled. If `amd-pstate` is selected, but hardware support
is not available, Xen will fallback to cpufreq=xen.
+* `active` is a boolean to enable amd-pstate driver in active(autonomous) mode.
+ In this mode, users could provide a hint with energy performance preference
+ register to the hardware if they want to bias toward performance(0x0) or
+ energy efficiency(0xff), then CPPC power algorithm will calculate the runtime
+ workload and adjust the realtime cores frequency according to the power supply
+ and themal, core voltage and some other hardware conditions.
There is also support for `;`-separated fallback options:
`cpufreq=hwp;xen,verbose`. This first tries `hwp` and falls back to `xen` if
@@ -27,6 +27,8 @@
#define amd_pstate_warn(fmt, args...) \
printk(XENLOG_WARNING "AMD_PSTATE: CPU%u warning: " fmt, cpu, ## args)
+static bool __ro_after_init opt_cpufreq_active = false;
+
struct amd_pstate_drv_data
{
struct xen_processor_cppc *cppc_data;
@@ -76,6 +78,13 @@ static bool __init amd_pstate_handle_option(const char *s, const char *end)
return true;
}
+ ret = parse_boolean("active", s, end);
+ if ( ret >= 0 )
+ {
+ opt_cpufreq_active = ret;
+ return true;
+ }
+
return false;
}
@@ -398,5 +407,6 @@ int __init amd_pstate_register_driver(void)
if ( !cpu_has_cppc )
return -ENODEV;
- return cpufreq_register_driver(&amd_pstate_cpufreq_driver);
+ if ( !opt_cpufreq_active )
+ return cpufreq_register_driver(&amd_pstate_cpufreq_driver);
}