OSDN Git Service

target/riscv: Avoid reporting odd-numbered pmpcfgX in the CSR XML for RV64
authorBin Meng <bmeng@tinylab.org>
Tue, 28 Feb 2023 10:40:26 +0000 (18:40 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 2 Mar 2023 00:40:18 +0000 (16:40 -0800)
commit04733fb0916f4b2b240da42342374b05d5dfc389
tree9c31422459780e38e85db18314c53cdc1711c702
parent94e297071bc0a5965cc32c497a886f2cf9d32710
target/riscv: Avoid reporting odd-numbered pmpcfgX in the CSR XML for RV64

At present the odd-numbered PMP configuration registers for RV64 are
reported in the CSR XML by QEMU gdbstub. However these registers do
not exist on RV64 so trying to access them from gdb results in 'E14'.

Move the pmpcfgX index check from the actual read/write routine to
the PMP CSR predicate() routine, so that non-existent pmpcfgX won't
be reported in the CSR XML for RV64.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-11-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
target/riscv/csr.c