x86/topology: Add support for Low Power cpu_type
Status from this message: The following commit has been merged into the x86/cpu branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 0 repliesApplied
- v12 patches 12 repliesSuperseded
Changes in v2 from the cover letter
- New preparatory patch 1/3 from Borislav Petkov switching x86_match_cpu() to the vendor-agnostic TOPO_CPU_TYPE_* enum; see its commit message for the rationale. (Thomas Gleixner, Borislav Petkov)
- No change to the Low Power translation logic itself; patches 2/3 and 3/3 are the v1 patches rebased on top of the new 1/3.
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | x86/topo: Map vendor CPU types to generic Linux such typesarch/ arch/ arch/ +4 more | +28 | 0 replies | |
| 2/3 | x86/topology: Name the AMD core-type valuesarch/ arch/ | +8 | 0 replies | |
| 3/3 | x86/topology: Add TOPO_CPU_TYPE_LOW_POWERarch/ arch/ arch/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] x86/topology: Add support for Low Power cpu_type
This series extends the x86 topology cpu_type classification to support a Low Power core type, in addition to the existing Performance and Efficiency types.
AMD heterogeneous parts report the core type via CPUID Fn0x80000026 EBX[31:28] (Extended CPU Topology, Core Type). Value 2 identifies a low-power core. Distinguishing it from a regular efficiency core matters for:
- user space exposure via /sys/kernel/debug/x86/topo/cpus/*, which today reports cpu_type "unknown" for low-power cores
- amd_get_boost_ratio_numerator(): on every X86_FEATURE_AMD_HTR_CORES-capable AMD/Hygon part, low-power cores must scale by amd_get_highest_perf() rather than the fixed CPPC_HIGHEST_PERF_PERFORMANCE ceiling, matching the existing efficiency-core path
During the v1 review, Sashiko flagged a pre-existing issue in how x86_match_cpu() handles vendor CPU types. v2 therefore starts with a preparatory patch from Borislav that switches matching to the kernel's vendor-agnostic TOPO_CPU_TYPE_* enum; see its commit message for details. The Low Power support is then added on top.
The series is structured as:
1/3 Map the vendor (Intel/AMD) hardware core type to the
vendor-agnostic enum x86_topology_cpu_type at enumeration and match against it. See the patch's commit message for details.
2/3 Replace the bare 0/1 in get_topology_cpu_type() with named
enum amd_cpu_type constants, mirroring the existing Intel side. No functional change.
3/3 Add TOPO_CPU_TYPE_LOW_POWER, wire it through
get_topology_cpu_type(), get_topology_cpu_type_name() and the switch in amd_get_boost_ratio_numerator() so allmodconfig builds cleanly under -Werror=switch.
Changes in v2:
- New preparatory patch 1/3 from Borislav Petkov switching x86_match_cpu() to the vendor-agnostic TOPO_CPU_TYPE_* enum; see its commit message for the rationale. (Thomas Gleixner, Borislav Petkov)
- No change to the Low Power translation logic itself; patches 2/3 and 3/3 are the v1 patches rebased on top of the new 1/3.
v1: https://lore.kernel.org/all/[email protected]
Borislav Petkov (AMD) (1):
x86/topo: Map vendor CPU types to generic Linux such types
Vishal Badole (2):
x86/topology: Name the AMD core-type values
x86/topology: Add TOPO_CPU_TYPE_LOW_POWER
arch/x86/include/asm/processor.h | 19 +++++++++++++---- arch/x86/include/asm/topology.h | 9 ++++---- arch/x86/kernel/acpi/cppc.c | 7 ++++--- arch/x86/kernel/cpu/match.c | 30 +-------------------------- arch/x86/kernel/cpu/topology.h | 1 + arch/x86/kernel/cpu/topology_amd.c | 6 ++++-- arch/x86/kernel/cpu/topology_common.c | 15 ++++++++++---- 7 files changed, 40 insertions(+), 47 deletions(-)
Signature · 1 line
2.34.1