[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] RISC-V: Correct typo in RV32 perf counters
From: |
Michael Clark |
Subject: |
[Qemu-trivial] [PATCH] RISC-V: Correct typo in RV32 perf counters |
Date: |
Fri, 25 May 2018 18:24:48 +1200 |
This patch enables mhpmcounter3h through mhpmcounter31h on RV32.
Previously the RV32 h versions (high 32-bits of 64-bit counters)
of these counters would trap with an illegal instruction instead
of returning 0 as intended.
Reported-by: Richard Henderson <address@hidden>
Signed-off-by: Michael Clark <address@hidden>
---
target/riscv/op_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c
index 3abf52453cfc..1f6dc9a85852 100644
--- a/target/riscv/op_helper.c
+++ b/target/riscv/op_helper.c
@@ -406,7 +406,7 @@ target_ulong csr_read_helper(CPURISCVState *env,
target_ulong csrno)
return 0;
}
#if defined(TARGET_RISCV32)
- if (csrno >= CSR_MHPMCOUNTER3 && csrno <= CSR_MHPMCOUNTER31) {
+ if (csrno >= CSR_MHPMCOUNTER3H && csrno <= CSR_MHPMCOUNTER31H) {
return 0;
}
#endif
--
2.7.0
- [Qemu-trivial] [PATCH] RISC-V: Correct typo in RV32 perf counters,
Michael Clark <=