Skip to content

ARM: implement cacheinfo support (for v7/v7m)

Dmitry Baryshkov linux-arm-kernel linux-arm-msm linux-samsung-soc lkml 4 versions – In review

Get series with b4
b4 am [email protected] change-id 20231231-armv7-cacheinfo-9fa533ae371e

Versions newest first

  1. v2 Latest2 patches 11 repliesIn review
  2. v1 posting 3/32 patches 0 repliesSuperseded
  3. v1 posting 2/32 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 posting 1/32 patches0 repliesSuperseded

Changes in v2 from the cover letter

- Handle cores like ARM1176, which have cpu_architecture() ==
CPU_ARCH_ARMv7 (because of VMSAv7 implementation), but no CLIDR
register (because they are ARMv6) (Arnd).
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ARM: add CLIDR accessor functionsarch/arm/include/asm/cachetype.h+13 -01 reply
2/2ARM: implement cacheinfo supportarch/arm/Kconfig arch/arm/include/asm/cache.h arch/arm/kernel/Makefile +2 more+182 -13 replies

Reviews trailers per patch

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

PatchLinus Walleij
1/2R-b
2/2R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/2] ARM: implement cacheinfo support (for v7/v7m)

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

---
Changes in v2:
- Handle cores like ARM1176, which have cpu_architecture() ==
CPU_ARCH_ARMv7 (because of VMSAv7 implementation), but no CLIDR
register (because they are ARMv6) (Arnd).
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Dmitry Baryshkov (2):
ARM: add CLIDR accessor functions
ARM: implement cacheinfo support

 arch/arm/Kconfig                 |   1 +
 arch/arm/include/asm/cache.h     |   6 ++
 arch/arm/include/asm/cachetype.h |  13 +++
 arch/arm/kernel/Makefile         |   1 +
 arch/arm/kernel/cacheinfo.c      | 173 +++++++++++++++++++++++++++++++++++++++
 include/linux/cacheinfo.h        |   2 +-
 6 files changed, 195 insertions(+), 1 deletion(-)

---
base-commit: 7f773fd61baa9b136faa5c4e6555aa64c758d07c
change-id: 20231231-armv7-cacheinfo-9fa533ae371e

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>