mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
target/riscv: Support hstatus[HUKTE] bit when svukte extension is enabled
Svukte extension add HUKTE bit, bit[24] in hstatus CSR. The written value will be masked when the svukte extension is not enabled. When hstatus[HUKTE] bit is set, HLV/HLVX/HSV work in the U-mode should do svukte check. Signed-off-by: Fea.Wang <fea.wang@sifive.com> Reviewed-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Jim Shu <jim.shu@sifive.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20241203034932.25185-4-fea.wang@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
81c8436277
commit
19eb69d09a
2 changed files with 4 additions and 0 deletions
|
@ -604,6 +604,7 @@ typedef enum {
|
|||
#define HSTATUS_VTVM 0x00100000
|
||||
#define HSTATUS_VTW 0x00200000
|
||||
#define HSTATUS_VTSR 0x00400000
|
||||
#define HSTATUS_HUKTE 0x01000000
|
||||
#define HSTATUS_VSXL 0x300000000
|
||||
|
||||
#define HSTATUS32_WPRI 0xFF8FF87E
|
||||
|
|
|
@ -3540,6 +3540,9 @@ static RISCVException read_hstatus(CPURISCVState *env, int csrno,
|
|||
static RISCVException write_hstatus(CPURISCVState *env, int csrno,
|
||||
target_ulong val)
|
||||
{
|
||||
if (!env_archcpu(env)->cfg.ext_svukte) {
|
||||
val = val & (~HSTATUS_HUKTE);
|
||||
}
|
||||
env->hstatus = val;
|
||||
if (riscv_cpu_mxl(env) != MXL_RV32 && get_field(val, HSTATUS_VSXL) != 2) {
|
||||
qemu_log_mask(LOG_UNIMP,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue