Skip to content

cacheinfo: Set cache 'id' based on DT data

James Morse linux-arm-kernel lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 9 repliesSuperseded
  3. v15 patches 19 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cacheinfo: Set cache 'id' based on DT datadrivers/base/cacheinfo.c+45 -00 replies
2/3cacheinfo: Add arch hook to compress CPU h/w id into 32 bits for cache-iddrivers/base/cacheinfo.c+5 -00 replies
3/3arm64: cacheinfo: Provide helper to compress MPIDR value into u32arch/arm64/include/asm/cache.h+17 -01 reply

Reviews trailers per patch

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

PatchJonathan CameronGavin Shan
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/3] cacheinfo: Set cache 'id' based on DT data

Changes since v2?
* Fixed a of node ref leak in patch 1.

---

This series adds support for cache-ids to device-tree systems. These values are exposed to user-space via /sys/devices/system/cpu/cpuX/cache/indexY/id
and are used to identify caches and their associated CPUs by kernel interfaces such as resctrl.

Resctrl anticipates cache-ids are unique for a given cache level, but may be sparse. See Documentation/filesystems/resctrl.rst's "Cache IDs" section.

Another user is PCIe's cache-steering hints, where an id provided by the hardware would be needed. Today this expects a platform specific ACPI hook the program that value into the PCIe root port registers. If DT platforms are ever supported, it will likely need a kernel driver to convert the user-space cache-id to whatever hardware value is needed.

This series generates a 32bit cache-id from the lowest CPU hardware id of the CPU's associated with that cache. On arm64, CPU hardware ids may be greater than 32bits, but can be swizzled into 32bits. An architecture hook is provided to allow the architecture to swizzle the values into 32bits.

This series is based on v6.16-rc4, and can be retrieved from:
https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/cacheinfo/v3

The MPAM driver that makes use of these can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/snapshot/v6.16-rc4

What is MPAM? Set your time-machine to 2020:
https://lore.kernel.org/lkml/[email protected]/

[v2] lore.kernel.org/r/[email protected] [v1] lore.kernel.org/r/[email protected]

Bugs welcome,
Thanks,

James Morse (2):
cacheinfo: Add arch hook to compress CPU h/w id into 32 bits for
cache-id
arm64: cacheinfo: Provide helper to compress MPIDR value into u32

Rob Herring (1):
cacheinfo: Set cache 'id' based on DT data

 arch/arm64/include/asm/cache.h | 17 ++++++++++++
 drivers/base/cacheinfo.c       | 50 ++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
Signature · 1 line
2.39.5