From: Nils Asmussen Date: Mon, 24 Feb 2020 12:47:43 +0000 (+0100) Subject: arch-riscv: ignore writes to SXL/UXL fields in status register. X-Git-Tag: v20.0.0.0~117 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aaf294af5c8e027ba68ddb41198d6f09aee4aeed;p=gem5.git arch-riscv: ignore writes to SXL/UXL fields in status register. We currently only support SXL=UXL=2 (64 bit). These fields are WARL, so that we have to make sure that no other value can be set. Change-Id: I62ddc7d68b8c31ca655ba1ccee7a294912f46b09 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25651 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/src/arch/riscv/isa.cc b/src/arch/riscv/isa.cc index 754ff85b7..a2fbd8043 100644 --- a/src/arch/riscv/isa.cc +++ b/src/arch/riscv/isa.cc @@ -347,6 +347,15 @@ ISA::setMiscReg(int misc_reg, RegVal val, ThreadContext *tc) setMiscRegNoEffect(misc_reg, new_val); } break; + case MISCREG_STATUS: + { + // SXL and UXL are hard-wired to 64 bit + auto cur = readMiscRegNoEffect(misc_reg); + val &= ~(STATUS_SXL_MASK | STATUS_UXL_MASK); + val |= cur & (STATUS_SXL_MASK | STATUS_UXL_MASK); + setMiscRegNoEffect(misc_reg, val); + } + break; default: setMiscRegNoEffect(misc_reg, val); }