Skip to content

RFC arm64: expose CPU prefetch and cache modulation controls

KobaK linux-arm-kernel linux-doc linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v6 RFC Latest3 patches 1 replyIn review

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3arm64: add CPU prefetch and cache modulation sysfs interfacearch/arm64/Kconfig arch/arm64/kernel/Makefile arch/arm64/kernel/arm_cpumod.c +1 more+602 -00 replies
2/3Documentation/arch/arm64: document arm_cpumodDocumentation/arch/arm64/arm-cpumod.rst Documentation/arch/arm64/index.rst+90 -00 replies
3/3selftests: arm64: add arm_cpumod kselftesttools/testing/selftests/arm64/Makefile tools/testing/selftests/arm64/arm_cpumod/Makefile tools/testing/selftests/arm64/arm_cpumod/arm_cpumod.sh+532 -10 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchFenghua YuTushar DaveKai-Heng Feng
1/3R-b R-b R-b
2/3R-b R-b R-b
3/3R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [RFC PATCH v6 0/3] arm64: expose CPU prefetch and cache modulation controls

From: Koba Ko <[email protected]>

This series adds CONFIG_ARM64_CPUMOD, a default-off arm64 interface for controlled performance characterization of selected implementation-defined CPU prefetch and cache-management fields. It exposes a small set of named, per-CPU attributes under the path below, with writable control fields range-checked before register state is changed:

/sys/devices/system/cpu/cpuN/cpumod/

The directory is created for online CPUs whose MIDR matches a recognized Grace or Vera profile, with common and profile-specific attributes selected for that CPU. Register accesses execute on the CPU that owns the sysfs instance, and CPU hotplug creates or removes the per-CPU subtree as the CPU transitions online or offline. Unsupported CPU profiles are skipped without blocking module load or CPU hotplug.

The implementation keeps each dynamically allocated kobject in a private per-CPU pointer, avoiding use of the CPU device's shared driver-data slot. The documentation defines the ABI, firmware prerequisite, and hotplug lifecycle. The kselftest validates profile-specific layout, unsupported-CPU skipping, decimal affected_cpus reporting, value validation, optional writes, all-online-CPU coverage, and cleanup.

The controls require firmware to permit EL1 access to the relevant implementation control registers. This is an RFC interface for controlled evaluation, not a general raw-register or production-default tuning ABI.

Compile and static verification passed. DUT runtime validation was not run.

Koba Ko (3):
arm64: add CPU prefetch and cache modulation sysfs interface Documentation/arch/arm64: document arm_cpumod
selftests: arm64: add arm_cpumod kselftest

 Documentation/arch/arm64/arm-cpumod.rst       |  89 +++
 Documentation/arch/arm64/index.rst            |   1 +
 arch/arm64/Kconfig                            |  17 +
 arch/arm64/kernel/Makefile                    |   1 +
 arch/arm64/kernel/arm_cpumod.c                | 471 ++++++++++++++++
 arch/arm64/kernel/arm_cpumod_internal.h       | 113 ++++
 tools/testing/selftests/arm64/Makefile        |   2 +-
 .../selftests/arm64/arm_cpumod/Makefile       |   5 +
 .../selftests/arm64/arm_cpumod/arm_cpumod.sh  | 526 ++++++++++++++++++
 9 files changed, 1224 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/arch/arm64/arm-cpumod.rst
 create mode 100644 arch/arm64/kernel/arm_cpumod.c
 create mode 100644 arch/arm64/kernel/arm_cpumod_internal.h
 create mode 100644 tools/testing/selftests/arm64/arm_cpumod/Makefile
 create mode 100755 tools/testing/selftests/arm64/arm_cpumod/arm_cpumod.sh
Signature · 1 line
2.43.0