Skip to content

amd-cppc CPU Performance Scaling Driver

Penny Zheng xen-devel 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest8 patches 8 repliesIn review
  2. v98 patches 20 repliesSuperseded
  3. v88 patches 23 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v713 patches29 repliesSuperseded
v619 patches46 repliesSuperseded
v518 patches58 repliesSuperseded
v415 patches56 repliesSuperseded
v315 patches44 repliesSuperseded
v211 patches31 repliesSuperseded
v111 patches24 repliesSuperseded

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8xen/cpufreq: make HW_ALL the only expected value for CPPC modexen/drivers/cpufreq/cpufreq.c+10 -01 reply
2/8xen/cpufreq: implement amd-cppc driver for CPPC in passive modexen/arch/x86/acpi/cpufreq/amd-cppc.c xen/arch/x86/cpu/amd.c xen/arch/x86/include/asm/amd.h +2 more+430 -50 replies
3/8xen/cpufreq: implement amd-cppc-epp driver for CPPC in active modedocs/misc/xen-command-line.pandoc xen/arch/x86/acpi/cpufreq/amd-cppc.c xen/drivers/cpufreq/utility.c +2 more+173 -50 replies
4/8xen/cpufreq: get performance policy from governor set via xenpmxen/drivers/acpi/pm-op.c+11 -00 replies
5/8tools/cpufreq: extract CPPC para from cpufreq paratools/include/xenctrl.h tools/libs/ctrl/xc_pm.c tools/misc/xenpm.c +2 more+155 -961 reply
6/8xen/cpufreq: bypass governor-related para for amd-cppc-epptools/misc/xenpm.c xen/drivers/acpi/pm-op.c xen/include/acpi/cpufreq/cpufreq.h+21 -51 reply
7/8xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc drivertools/misc/xenpm.c xen/arch/x86/acpi/cpufreq/amd-cppc.c xen/drivers/acpi/pm-op.c +1 more+196 -134 replies
8/8CHANGELOG.md: add amd-cppc/amd-cppc-epp cpufreq driver supportCHANGELOG.md+1 -01 reply

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchJan BeulichAnthony PERARD
1/8R-b
2/8A-b
3/8A-b
4/8A-b
5/8A-b A-b
6/8A-b A-b
7/8A-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v10 thread

Cover letter [PATCH v10 0/8] amd-cppc CPU Performance Scaling Driver

amd-cppc is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on modern AMD APU and CPU series in Xen. The new mechanism is based on Collaborative Processor Performance Control (CPPC) which provides finer grain frequency management than legacy ACPI hardware P-States. Current AMD CPU/APU platforms are using the ACPI P-states driver to manage CPU frequency and clocks with switching only in 3 P-states. CPPC replaces the ACPI P-states controls and allows a flexible, low-latency interface for Xen to directly communicate the performance hints to hardware.

amd_cppc driver has 2 operation modes: autonomous (active) mode, and non-autonomous (passive) mode. We register different CPUFreq driver for different modes, "amd-cppc" for passive mode and "amd-cppc-epp" for active mode.

The passive mode leverages common governors such as *ondemand*, *performance*, etc, to manage the performance tuning. While the active mode uses epp to provides a hint to the hardware if software wants to bias toward performance (0x0) or energy efficiency (0xff). CPPC power algorithm in hardware will automatically calculate the runtime workload and adjust the realtime cpu cores frequency according to the power supply and thermal, core voltage and some other hardware conditions.

amd-cppc is enabled on passive mode with a top-level cpufreq=amd-cppc option, while users add extra active flag to select active mode.

With cpufreq=amd-cppc,active, we did a 60s sampling test to see the CPU frequency change, through tweaking the energy_perf preference from xenpm set-cpufreq-cppc powersave to xenpm set-cpufreq-cppc performance. The outputs are as follows:

```
Setting CPU in powersave mode
Sampling and Outputs:
  Avg freq      580000 KHz
  Avg freq      580000 KHz
  Avg freq      580000 KHz
Setting CPU in performance mode
Sampling and Outputs:
  Avg freq      4640000 KHz
  Avg freq      4220000 KHz
  Avg freq      4640000 KHz
```

Penny Zheng (8):
xen/cpufreq: make HW_ALL the only expected value for CPPC mode xen/cpufreq: implement amd-cppc driver for CPPC in passive mode xen/cpufreq: implement amd-cppc-epp driver for CPPC in active mode xen/cpufreq: get performance policy from governor set via xenpm tools/cpufreq: extract CPPC para from cpufreq para xen/cpufreq: bypass governor-related para for amd-cppc-epp xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc
driver
CHANGELOG.md: add amd-cppc/amd-cppc-epp cpufreq driver support

 CHANGELOG.md                         |   1 +
 docs/misc/xen-command-line.pandoc    |   9 +-
 tools/include/xenctrl.h              |  27 +-
 tools/libs/ctrl/xc_pm.c              |  47 +-
 tools/misc/xenpm.c                   | 118 +++--
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 709 ++++++++++++++++++++++++++-
 xen/arch/x86/cpu/amd.c               |   8 +-
 xen/arch/x86/include/asm/amd.h       |   2 +
 xen/arch/x86/include/asm/msr-index.h |   6 +
 xen/drivers/acpi/pm-op.c             |  78 ++-
 xen/drivers/cpufreq/cpufreq.c        |  10 +
 xen/drivers/cpufreq/utility.c        |  15 +
 xen/include/acpi/cpufreq/cpufreq.h   |  34 ++
 xen/include/public/sysctl.h          |  33 +-
 14 files changed, 985 insertions(+), 112 deletions(-)
Signature · 1 line
2.34.1