[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 22/22] target/riscv: Relax UXL field for debugging
From: |
LIU Zhiwei |
Subject: |
[PATCH v7 22/22] target/riscv: Relax UXL field for debugging |
Date: |
Wed, 19 Jan 2022 13:18:24 +0800 |
Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/csr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 90f78eca65..c6b2407a06 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -584,7 +584,7 @@ static RISCVException write_mstatus(CPURISCVState *env, int
csrno,
MSTATUS_MPP | MSTATUS_MXR | MSTATUS_TVM | MSTATUS_TSR |
MSTATUS_TW | MSTATUS_VS;
- if (xl != MXL_RV32) {
+ if (xl != MXL_RV32 || env->debugger) {
/*
* RV32: MPV and GVA are not in mstatus. The current plan is to
* add them to mstatush. For now, we just don't support it.
@@ -909,7 +909,7 @@ static RISCVException read_sstatus(CPURISCVState *env, int
csrno,
target_ulong *val)
{
target_ulong mask = (sstatus_v1_10_mask);
- if (env->xl != MXL_RV32) {
+ if (env->xl != MXL_RV32 || env->debugger) {
mask |= SSTATUS64_UXL;
}
/* TODO: Use SXL not MXL. */
@@ -921,7 +921,8 @@ static RISCVException write_sstatus(CPURISCVState *env, int
csrno,
target_ulong val)
{
target_ulong mask = (sstatus_v1_10_mask);
- if (env->xl != MXL_RV32) {
+
+ if (env->xl != MXL_RV32 || env->debugger) {
mask |= SSTATUS64_UXL;
}
target_ulong newval = (env->mstatus & ~mask) | (val & mask);
--
2.25.1
- [PATCH v7 17/22] target/riscv: Remove VILL field in VTYPE, (continued)
- [PATCH v7 17/22] target/riscv: Remove VILL field in VTYPE, LIU Zhiwei, 2022/01/19
- [PATCH v7 18/22] target/riscv: Fix check range for first fault only, LIU Zhiwei, 2022/01/19
- [PATCH v7 19/22] target/riscv: Adjust vector address with mask, LIU Zhiwei, 2022/01/19
- [PATCH v7 20/22] target/riscv: Adjust scalar reg in vector with XLEN, LIU Zhiwei, 2022/01/19
- [PATCH v7 21/22] target/riscv: Enable uxl field write, LIU Zhiwei, 2022/01/19
- Re: [PATCH v7 21/22] target/riscv: Enable uxl field write, LIU Zhiwei, 2022/01/19
[PATCH v7 22/22] target/riscv: Relax UXL field for debugging,
LIU Zhiwei <=