Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: riscv: Fixed misalignment of CSR related definitions

The file tools/arch/riscv/include/asm/csr.h borrows from
arch/riscv/include/asm/csr.h, and subsequent modifications
related to CSR should maintain consistency.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Link: https://patch.msgid.link/20251114071215.816-1-cp0613@linux.alibaba.com
[pjw@kernel.org: dropped Fixes: lines for patches that weren't broken; removed superfluous blank line]
Signed-off-by: Paul Walmsley <pjw@kernel.org>

authored by

Chen Pei and committed by
Paul Walmsley
e2cb6926 7b090e7b

+4 -3
+1 -1
drivers/perf/riscv_pmu_sbi.c
··· 1109 1109 /* compute hardware counter index */ 1110 1110 hidx = info->csr - CSR_CYCLE; 1111 1111 1112 - /* check if the corresponding bit is set in sscountovf or overflow mask in shmem */ 1112 + /* check if the corresponding bit is set in scountovf or overflow mask in shmem */ 1113 1113 if (!(overflow & BIT(hidx))) 1114 1114 continue; 1115 1115
+3 -2
tools/arch/riscv/include/asm/csr.h
··· 167 167 #define VSIP_TO_HVIP_SHIFT (IRQ_VS_SOFT - IRQ_S_SOFT) 168 168 #define VSIP_VALID_MASK ((_AC(1, UL) << IRQ_S_SOFT) | \ 169 169 (_AC(1, UL) << IRQ_S_TIMER) | \ 170 - (_AC(1, UL) << IRQ_S_EXT)) 170 + (_AC(1, UL) << IRQ_S_EXT) | \ 171 + (_AC(1, UL) << IRQ_PMU_OVF)) 171 172 172 173 /* AIA CSR bits */ 173 174 #define TOPI_IID_SHIFT 16 ··· 281 280 #define CSR_HPMCOUNTER30H 0xc9e 282 281 #define CSR_HPMCOUNTER31H 0xc9f 283 282 284 - #define CSR_SSCOUNTOVF 0xda0 283 + #define CSR_SCOUNTOVF 0xda0 285 284 286 285 #define CSR_SSTATUS 0x100 287 286 #define CSR_SIE 0x104