[PATCH v2 0/3] cacheinfo: Correctly fallback to using clidr_el1's information

From: Pierre Gondois
Date: Wed Apr 12 2023 - 03:18:34 EST


v2:
cacheinfo: Check sib_leaf in cache_leaves_are_shared()
- Reformulate commit message
- Add 'Fixes: f16d1becf96f ("cacheinfo: Use cache identifiers [...]'
cacheinfo: Check cache properties are present in DT
- Use of_property_present()
- Add 'Reported-by: Alexandre Ghiti <alexghiti@xxxxxxxxxxxx>'
cacheinfo: Add use_arch[|_cache]_info field/function:
- Make use_arch_cache_info() a static inline function

The cache information can be extracted from either a Device
Tree (DT), the PPTT ACPI table, or arch registers (clidr_el1
for arm64).

When the DT is used but no cache properties are advertised,
the current code doesn't correctly fallback to using arch information.

Correct this. Also use the assumption that L1 data/instruction caches
are private and L2/higher caches are shared when the cache information
is coming form clidr_el1.

Pierre Gondois (3):
cacheinfo: Check sib_leaf in cache_leaves_are_shared()
cacheinfo: Check cache properties are present in DT
cacheinfo: Add use_arch[|_cache]_info field/function

drivers/base/cacheinfo.c | 48 +++++++++++++++++++++++++++++++++++----
include/linux/cacheinfo.h | 11 +++++++++
2 files changed, 55 insertions(+), 4 deletions(-)

--
2.25.1