aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng@tinylab.org>2023-02-28 21:45:31 +0800
committerPalmer Dabbelt <palmer@rivosinc.com>2023-03-01 16:40:22 -0800
commitddb10742f1acce17dbb8f3551af01bf5bfc4fa14 (patch)
tree2986d8d9265f1db5c742e95a1bb696e5e18aa1ed
parentfb517fdb150b71d6fad8e2332c9aace82143e45f (diff)
downloadqemu-ddb10742f1acce17dbb8f3551af01bf5bfc4fa14.zip
qemu-ddb10742f1acce17dbb8f3551af01bf5bfc4fa14.tar.gz
qemu-ddb10742f1acce17dbb8f3551af01bf5bfc4fa14.tar.bz2
target/riscv: Allow debugger to access seed CSR
At present seed CSR is not reported in the CSR XML hence gdb cannot access it. Fix it by adding a debugger check in its predicate() routine. 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-15-bmeng@tinylab.org> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-rw-r--r--target/riscv/csr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 10ae5df..15b23b9 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -459,6 +459,10 @@ static RISCVException seed(CPURISCVState *env, int csrno)
}
#if !defined(CONFIG_USER_ONLY)
+ if (env->debugger) {
+ return RISCV_EXCP_NONE;
+ }
+
/*
* With a CSR read-write instruction:
* 1) The seed CSR is always available in machine mode as normal.