Get cache information from userland
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest3 patches 2 repliesIn review
- v33 patches 6 repliesSuperseded
- v23 patches 2 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 6 replies | Superseded |
Changes in v4 from the cover letter
- Check null pointer before use.
- Re-write the code for readability.
- Rebase source to v5.9-rc3.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | riscv: Set more data to cacheinfoarch/ | +51 | 0 replies | |
| 2/3 | riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFOarch/ | +3 | 0 replies | |
| 3/3 | riscv: Add cache information in AUX vectorarch/ arch/ arch/ +1 more | +71 | 0 replies |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Palmer Dabbelt | Pekka Enberg |
|---|---|---|
| Series | R-b | |
| 1/3 | ||
| 2/3 | R-b | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/3] Get cache information from userland
There are no standard CSR registers to provide cache information, the way for RISC-V is to get this information from DT. Currently, AT_L1I_X, AT_L1D_X and AT_L2_X are present in glibc header, and sysconf syscall could use them to get information of cache through AUX vector. We exploit 'struct cacheinfo' to obtain the information of cache, then we don't need additional variable or data structure to record it.
We also need some works in glibc, but we have to support the function in kernel first by rule of glibc, then post the patch to glibc site.
The result of 'getconf -a' as follows:
LEVEL1_ICACHE_SIZE 32768 LEVEL1_ICACHE_ASSOC 8 LEVEL1_ICACHE_LINESIZE 64 LEVEL1_DCACHE_SIZE 32768 LEVEL1_DCACHE_ASSOC 8 LEVEL1_DCACHE_LINESIZE 64 LEVEL2_CACHE_SIZE 2097152 LEVEL2_CACHE_ASSOC 32 LEVEL2_CACHE_LINESIZE 64
Changed in v4:
- Check null pointer before use.
- Re-write the code for readability.
- Rebase source to v5.9-rc3.
Changed in v3:
- Fix sparse warning: Use NULL instead of integer 0.
Changed in v2:
- Add error checking for parsing cache properties.
Zong Li (3):
riscv: Set more data to cacheinfo
riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
riscv: Add cache information in AUX vector
arch/riscv/include/asm/cacheinfo.h | 5 ++ arch/riscv/include/asm/elf.h | 13 ++++ arch/riscv/include/uapi/asm/auxvec.h | 24 +++++++ arch/riscv/kernel/cacheinfo.c | 98 +++++++++++++++++++++++----- 4 files changed, 124 insertions(+), 16 deletions(-)
Signature · 7 lines
2.28.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv