[PATCH 00/16][SRU][OEM-5.14/Jammy] Support AMD P-State cpufreq control mechanism

You-Sheng Yang vicamo.yang at canonical.com
Fri Apr 8 02:38:22 UTC 2022


BugLink: https://bugs.launchpad.net/bugs/1956509

[Impact]

AMD P-State CPU performance scaling driver not yet supported on AMD Zen
based CPU series.

[Fix]

Mainline commits starting at commit d341db8f48ea ("x86/cpufeatures: Add
AMD Collaborative Processor Performance Control feature flag") from v5.17.

Even this committed, the defconfig will build it as module, and that
prevents AMD P-State driver from actually taking effect. Therefore an
additional fix to the kernel configs is necessary.

[Test Case]

$ sudo cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 3.10 GHz
  available cpufreq governors: conservative ondemand userspace powersave
performance schedutil
  current policy: frequency should be within 1.60 GHz and 3.10 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.59 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0: 3100MHz
    Pstate-P1: 1800MHz
    Pstate-P2: 1600MHz

[Where problems could occur]

The CPPC feature is implemented in two ways depending on underlying HW
details for the APU/CPU:
* Dedicated MSR
* Shared memory

The metrics used to measure power/performance efficiency don't show any
improvement on the designs that use shared memory. They do show
improvements in the MSR designs.

So the code will only enable it by default on the MSR implementation.

[Other Info]

Althought the v5.17 kernel and newer should have already this committed,
an additional fix to the kernel configs is necessary, and
unstable/oem-5.17 are also nominated (in a separate thread for they don't
need other parts but the config).

Huang Rui (12):
  x86/cpufeatures: Add AMD Collaborative Processor Performance Control
    feature flag
  x86/msr: Add AMD CPPC MSR definitions
  cpufreq: amd-pstate: Introduce a new AMD P-State driver to support
    future processors
  cpufreq: amd-pstate: Add fast switch function for AMD P-State
  cpufreq: amd-pstate: Introduce the support for the processors with
    shared memory solution
  cpufreq: amd-pstate: Add trace for AMD P-State module
  cpufreq: amd-pstate: Add boost mode support for AMD P-State
  cpufreq: amd-pstate: Add AMD P-State frequencies attributes
  cpufreq: amd-pstate: Add AMD P-State performance attributes
  Documentation: amd-pstate: Add AMD P-State driver introduction
  MAINTAINERS: Add AMD P-State driver maintainer entry
  cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State

Jinzhou Su (1):
  ACPI: CPPC: Add CPPC enable register function

Steven Noonan (1):
  ACPI: CPPC: Implement support for SystemIO registers

Yang Li (1):
  cpufreq: amd-pstate: Fix struct amd_cpudata kernel-doc comment

You-Sheng Yang (1):
  UBUNTU: [Config] enable X86_AMD_PSTATE as built-in on amd64

 Documentation/admin-guide/acpi/cppc_sysfs.rst |   2 +
 Documentation/admin-guide/pm/amd-pstate.rst   | 382 +++++++++++
 .../admin-guide/pm/working-state.rst          |   1 +
 MAINTAINERS                                   |   7 +
 arch/x86/include/asm/cpufeatures.h            |   1 +
 arch/x86/include/asm/msr-index.h              |  17 +
 debian.oem/config/annotations                 |   1 +
 debian.oem/config/config.common.ubuntu        |   1 +
 drivers/acpi/cppc_acpi.c                      |  97 ++-
 drivers/cpufreq/Kconfig.x86                   |  17 +
 drivers/cpufreq/Makefile                      |   5 +
 drivers/cpufreq/amd-pstate-trace.c            |   2 +
 drivers/cpufreq/amd-pstate-trace.h            |  77 +++
 drivers/cpufreq/amd-pstate.c                  | 645 ++++++++++++++++++
 include/acpi/cppc_acpi.h                      |   5 +
 15 files changed, 1257 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/admin-guide/pm/amd-pstate.rst
 create mode 100644 drivers/cpufreq/amd-pstate-trace.c
 create mode 100644 drivers/cpufreq/amd-pstate-trace.h
 create mode 100644 drivers/cpufreq/amd-pstate.c

-- 
2.34.1




More information about the kernel-team mailing list