summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2025-02-06 01:58:46 -0800
committerAlistair Francis <alistair.francis@wdc.com>2025-03-04 15:42:54 +1000
commit59eaf1570456b701fe6dfa4a8f747e65633c385f (patch)
tree1f525b57a9a95c01c8498a2c6b4842f20c0674af
parent81819038d7d01c6c8c12005b5904356efc09a909 (diff)
downloadfocaccia-qemu-59eaf1570456b701fe6dfa4a8f747e65633c385f.tar.gz
focaccia-qemu-59eaf1570456b701fe6dfa4a8f747e65633c385f.zip
target/riscv: Fix the hpmevent mask
As per the latest privilege specification v1.13[1], the sscofpmf
only reserves first 8 bits of hpmeventX. Update the corresponding
masks accordingly.

[1]https://github.com/riscv/riscv-isa-manual/issues/1578

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20250206-pmu_minor_fixes-v2-1-1bb0f4aeb8b4@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
-rw-r--r--target/riscv/cpu_bits.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h
index 70ef443c99..a30317c617 100644
--- a/target/riscv/cpu_bits.h
+++ b/target/riscv/cpu_bits.h
@@ -1078,9 +1078,8 @@ typedef enum CTRType {
                                             MHPMEVENTH_BIT_VSINH | \
                                             MHPMEVENTH_BIT_VUINH)
 
-#define MHPMEVENT_SSCOF_MASK               _ULL(0xFFFF000000000000)
-#define MHPMEVENT_IDX_MASK                 0xFFFFF
-#define MHPMEVENT_SSCOF_RESVD              16
+#define MHPMEVENT_SSCOF_MASK               MAKE_64BIT_MASK(63, 56)
+#define MHPMEVENT_IDX_MASK                 (~MHPMEVENT_SSCOF_MASK)
 
 /* RISC-V-specific interrupt pending bits. */
 #define CPU_INTERRUPT_RNMI                 CPU_INTERRUPT_TGT_EXT_0