Skip to content

Commit e2cb692

Browse files
cp0613Paul Walmsley
authored andcommitted
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>
1 parent 7b090e7 commit e2cb692

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/perf/riscv_pmu_sbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static irqreturn_t pmu_sbi_ovf_handler(int irq, void *dev)
11091109
/* compute hardware counter index */
11101110
hidx = info->csr - CSR_CYCLE;
11111111

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 */
11131113
if (!(overflow & BIT(hidx)))
11141114
continue;
11151115

tools/arch/riscv/include/asm/csr.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
#define VSIP_TO_HVIP_SHIFT (IRQ_VS_SOFT - IRQ_S_SOFT)
168168
#define VSIP_VALID_MASK ((_AC(1, UL) << IRQ_S_SOFT) | \
169169
(_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))
171172

172173
/* AIA CSR bits */
173174
#define TOPI_IID_SHIFT 16
@@ -280,7 +281,7 @@
280281
#define CSR_HPMCOUNTER30H 0xc9e
281282
#define CSR_HPMCOUNTER31H 0xc9f
282283

283-
#define CSR_SSCOUNTOVF 0xda0
284+
#define CSR_SCOUNTOVF 0xda0
284285

285286
#define CSR_SSTATUS 0x100
286287
#define CSR_SIE 0x104

0 commit comments

Comments
 (0)