Skip to content

Commit f297245

Browse files
LIU Zhiweialistair23
authored andcommitted
target/riscv: Relax UXL field for debugging
Signed-off-by: LIU Zhiwei <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Message-id: [email protected] Signed-off-by: Alistair Francis <[email protected]>
1 parent f310df5 commit f297245

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

target/riscv/csr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ static RISCVException write_mstatus(CPURISCVState *env, int csrno,
584584
MSTATUS_MPP | MSTATUS_MXR | MSTATUS_TVM | MSTATUS_TSR |
585585
MSTATUS_TW | MSTATUS_VS;
586586

587-
if (xl != MXL_RV32) {
587+
if (xl != MXL_RV32 || env->debugger) {
588588
/*
589589
* RV32: MPV and GVA are not in mstatus. The current plan is to
590590
* add them to mstatush. For now, we just don't support it.
@@ -900,7 +900,7 @@ static RISCVException read_sstatus_i128(CPURISCVState *env, int csrno,
900900
{
901901
uint64_t mask = sstatus_v1_10_mask;
902902
uint64_t sstatus = env->mstatus & mask;
903-
if (env->xl != MXL_RV32) {
903+
if (env->xl != MXL_RV32 || env->debugger) {
904904
mask |= SSTATUS64_UXL;
905905
}
906906

@@ -912,7 +912,7 @@ static RISCVException read_sstatus(CPURISCVState *env, int csrno,
912912
target_ulong *val)
913913
{
914914
target_ulong mask = (sstatus_v1_10_mask);
915-
if (env->xl != MXL_RV32) {
915+
if (env->xl != MXL_RV32 || env->debugger) {
916916
mask |= SSTATUS64_UXL;
917917
}
918918
/* TODO: Use SXL not MXL. */
@@ -925,7 +925,7 @@ static RISCVException write_sstatus(CPURISCVState *env, int csrno,
925925
{
926926
target_ulong mask = (sstatus_v1_10_mask);
927927

928-
if (env->xl != MXL_RV32) {
928+
if (env->xl != MXL_RV32 || env->debugger) {
929929
if ((val & SSTATUS64_UXL) != 0) {
930930
mask |= SSTATUS64_UXL;
931931
}

0 commit comments

Comments
 (0)