@@ -584,7 +584,7 @@ static RISCVException write_mstatus(CPURISCVState *env, int csrno,
584
584
MSTATUS_MPP | MSTATUS_MXR | MSTATUS_TVM | MSTATUS_TSR |
585
585
MSTATUS_TW | MSTATUS_VS ;
586
586
587
- if (xl != MXL_RV32 ) {
587
+ if (xl != MXL_RV32 || env -> debugger ) {
588
588
/*
589
589
* RV32: MPV and GVA are not in mstatus. The current plan is to
590
590
* 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,
900
900
{
901
901
uint64_t mask = sstatus_v1_10_mask ;
902
902
uint64_t sstatus = env -> mstatus & mask ;
903
- if (env -> xl != MXL_RV32 ) {
903
+ if (env -> xl != MXL_RV32 || env -> debugger ) {
904
904
mask |= SSTATUS64_UXL ;
905
905
}
906
906
@@ -912,7 +912,7 @@ static RISCVException read_sstatus(CPURISCVState *env, int csrno,
912
912
target_ulong * val )
913
913
{
914
914
target_ulong mask = (sstatus_v1_10_mask );
915
- if (env -> xl != MXL_RV32 ) {
915
+ if (env -> xl != MXL_RV32 || env -> debugger ) {
916
916
mask |= SSTATUS64_UXL ;
917
917
}
918
918
/* TODO: Use SXL not MXL. */
@@ -925,7 +925,7 @@ static RISCVException write_sstatus(CPURISCVState *env, int csrno,
925
925
{
926
926
target_ulong mask = (sstatus_v1_10_mask );
927
927
928
- if (env -> xl != MXL_RV32 ) {
928
+ if (env -> xl != MXL_RV32 || env -> debugger ) {
929
929
if ((val & SSTATUS64_UXL ) != 0 ) {
930
930
mask |= SSTATUS64_UXL ;
931
931
}
0 commit comments