mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
amd-cppc has 2 operation modes: autonomous (active) mode and non-autonomous (passive) mode. In active mode, we don't need Xen governor to calculate and tune the cpu frequency, while hardware built-in CPPC power algorithm will calculate the runtime workload and adjust cores frequency automatically according to the power supply, thermal, core voltage and some other hardware conditions. In active mode, CPPC ignores requests done in the desired performance field, and takes into account only the values set to the minimum performance, maximum performance, and energy performance preference registers. A new field EPP (energy performance preference), in CPPC request register, is introduced. It will be used in the CCLK DPM controller to drive the frequency that a core is going to operate during short periods of activity, called minimum active frequency, It could contatin a range of values from 0 to 0xff. An EPP of zero sets the min active frequency to maximum frequency, while an EPP of 0xff sets the min active frequency to approxiately Idle frequency. We implement a new AMD CPU frequency driver `amd-cppc-epp` for active mode. It requires `active` tag in Xen cmdline for users to explicitly select active mode. In driver `active-cppc-epp`, ->setpolicy() is hooked, not the ->target(), as it does not depend on xen governor to do performance tuning. We also introduce a new field "policy" (CPUFREQ_POLICY_xxx) to represent performance policy. Right now, it supports three values: CPUFREQ_POLICY_PERFORMANCE as maximum performance, CPUFREQ_POLICY_POWERSAVE as the least power consumption, and CPUFREQ_POLICY_ONDEMAND as no preference, just corresponding to "performance", "powersave" and "ondemand" Xen governor, which benefit users from re-using "governor" in Xen cmdline to deliver which performance policy they want to apply. Signed-off-by: Penny Zheng <Penny.Zheng@amd.com> Acked-by: Jan Beulich <jbeulich@suse.com>