All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/15] amd-cppc CPU Performance Scaling Driver
@ 2025-03-06  8:39 Penny Zheng
  2025-03-06  8:39 ` [PATCH v3 01/15] xen/cpufreq: introduces XEN_PM_PSD for solely delivery of _PSD Penny Zheng
                   ` (14 more replies)
  0 siblings, 15 replies; 60+ messages in thread
From: Penny Zheng @ 2025-03-06  8:39 UTC (permalink / raw)
  To: xen-devel
  Cc: ray.huang, Penny Zheng, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Anthony PERARD, Michal Orzel, Julien Grall,
	Stefano Stabellini, Juergen Gross

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 hints. And 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      2000000 KHz
  Avg freq      2000000 KHz
  Avg freq      2000000 KHz
Setting CPU in performance mode
Sampling and Outputs:
  Avg freq      4640000 KHz
  Avg freq      4220000 KHz
  Avg freq      4640000 KHz

Penny Zheng (15):
  xen/cpufreq: introduces XEN_PM_PSD for solely delivery of _PSD
  xen/x86: introduce new sub-hypercall to propagate CPPC data
  xen/cpufreq: refactor cmdline "cpufreq=xxx"
  xen/cpufreq: move XEN_PROCESSOR_PM_xxx to internal header
  xen/x86: introduce "cpufreq=amd-cppc" xen cmdline
  xen/cpufreq: disable px statistic info in amd-cppc mode
  xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs
  xen/amd: export processor max frequency value
  xen/x86: introduce a new amd cppc driver for cpufreq scaling
  xen/cpufreq: only set gov NULL when cpufreq_driver.setpolicy is NULL
  xen/cpufreq: abstract Energy Performance Preference value
  xen/x86: implement EPP support for the amd-cppc driver in active mode
  tools/xenpm: Print CPPC parameters for amd-cppc driver
  xen/xenpm: Adapt cpu frequency monitor in xenpm
  xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc
    driver

 docs/misc/xen-command-line.pandoc         |  27 +-
 tools/libs/ctrl/xc_pm.c                   |  12 +-
 tools/misc/xenpm.c                        |  23 +-
 xen/arch/x86/acpi/cpufreq/Makefile        |   1 +
 xen/arch/x86/acpi/cpufreq/acpi.c          |  14 +-
 xen/arch/x86/acpi/cpufreq/amd-cppc.c      | 681 ++++++++++++++++++++++
 xen/arch/x86/acpi/cpufreq/cpufreq.c       |  34 +-
 xen/arch/x86/acpi/cpufreq/hwp.c           |  10 +-
 xen/arch/x86/acpi/cpufreq/powernow.c      |   2 +-
 xen/arch/x86/cpu/amd.c                    |  37 +-
 xen/arch/x86/include/asm/amd.h            |   1 +
 xen/arch/x86/include/asm/msr-index.h      |   5 +
 xen/arch/x86/platform_hypercall.c         |  25 +
 xen/arch/x86/pv/dom0_build.c              |   1 -
 xen/arch/x86/setup.c                      |   1 +
 xen/arch/x86/x86_64/cpufreq.c             |   4 +
 xen/common/domain.c                       |   1 +
 xen/drivers/acpi/pmstat.c                 |  54 +-
 xen/drivers/cpufreq/cpufreq.c             | 258 +++++---
 xen/drivers/cpufreq/cpufreq_ondemand.c    |   2 +-
 xen/drivers/cpufreq/utility.c             |  18 +
 xen/include/acpi/cpufreq/cpufreq.h        |  31 +
 xen/include/acpi/cpufreq/processor_perf.h |  18 +-
 xen/include/public/platform.h             |  38 +-
 xen/include/public/sysctl.h               |   2 +
 xen/include/public/xen.h                  |   1 -
 xen/include/xen/pmstat.h                  |   4 +
 xen/include/xlat.lst                      |   3 +-
 28 files changed, 1160 insertions(+), 148 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/amd-cppc.c

-- 
2.34.1



^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2025-04-08 10:33 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06  8:39 [PATCH v3 00/15] amd-cppc CPU Performance Scaling Driver Penny Zheng
2025-03-06  8:39 ` [PATCH v3 01/15] xen/cpufreq: introduces XEN_PM_PSD for solely delivery of _PSD Penny Zheng
2025-03-24 14:08   ` Jan Beulich
2025-04-01  3:25     ` Penny, Zheng
2025-03-06  8:39 ` [PATCH v3 02/15] xen/x86: introduce new sub-hypercall to propagate CPPC data Penny Zheng
2025-03-24 14:28   ` Jan Beulich
2025-03-25  4:12     ` Penny, Zheng
2025-03-25  7:53       ` Jan Beulich
2025-03-28  8:27         ` Penny, Zheng
2025-03-28  8:36           ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx" Penny Zheng
2025-03-24 15:00   ` Jan Beulich
2025-03-26  7:20     ` Penny, Zheng
2025-03-26 10:43       ` Jan Beulich
2025-04-01  5:44         ` Penny, Zheng
2025-04-01  6:38           ` Jan Beulich
2025-04-01  6:56             ` Penny, Zheng
2025-03-06  8:39 ` [PATCH v3 04/15] xen/cpufreq: move XEN_PROCESSOR_PM_xxx to internal header Penny Zheng
2025-03-24 15:11   ` Jan Beulich
2025-03-26  7:48     ` Penny, Zheng
2025-03-06  8:39 ` [PATCH v3 05/15] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline Penny Zheng
2025-03-24 15:26   ` Jan Beulich
2025-03-26  8:35     ` Penny, Zheng
2025-03-26 10:55       ` Jan Beulich
2025-03-27  3:12         ` Penny, Zheng
2025-03-27  7:48           ` Jan Beulich
2025-03-28  4:43             ` Penny, Zheng
2025-03-25 10:00   ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 06/15] xen/cpufreq: disable px statistic info in amd-cppc mode Penny Zheng
2025-03-24 15:34   ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 07/15] xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs Penny Zheng
2025-03-24 15:47   ` Jan Beulich
2025-03-25 10:55     ` Nicola Vetrini
2025-03-26  9:54     ` Penny, Zheng
2025-03-26 10:14       ` Nicola Vetrini
2025-03-26 10:19         ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 08/15] xen/amd: export processor max frequency value Penny Zheng
2025-03-24 15:52   ` Jan Beulich
2025-03-27  8:38     ` Penny, Zheng
2025-03-06  8:39 ` [PATCH v3 09/15] xen/x86: introduce a new amd cppc driver for cpufreq scaling Penny Zheng
2025-03-25  9:57   ` Jan Beulich
2025-03-25 13:58     ` Jason Andryuk
2025-04-03  7:40     ` Penny, Zheng
2025-04-03  7:54       ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 10/15] xen/cpufreq: only set gov NULL when cpufreq_driver.setpolicy is NULL Penny Zheng
2025-03-24 16:32   ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 11/15] xen/cpufreq: abstract Energy Performance Preference value Penny Zheng
2025-03-25 10:13   ` Jan Beulich
2025-03-06  8:39 ` [PATCH v3 12/15] xen/x86: implement EPP support for the amd-cppc driver in active mode Penny Zheng
2025-03-25 10:48   ` Jan Beulich
2025-03-28  4:07     ` Penny, Zheng
2025-03-28  7:18       ` Jan Beulich
2025-04-08 10:32         ` Penny, Zheng
2025-03-06  8:39 ` [PATCH v3 13/15] tools/xenpm: Print CPPC parameters for amd-cppc driver Penny Zheng
2025-03-06  8:39 ` [PATCH v3 14/15] xen/xenpm: Adapt cpu frequency monitor in xenpm Penny Zheng
2025-03-25 11:26   ` Jan Beulich
2025-03-25 16:37     ` Jason Andryuk
2025-03-26 15:45     ` Anthony PERARD
2025-03-06  8:39 ` [PATCH v3 15/15] xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc driver Penny Zheng
2025-03-25 16:59   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.