[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.8 36/49] target/riscv: Correct SXL return value for RV32 in
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.8 36/49] target/riscv: Correct SXL return value for RV32 in RV64 QEMU |
Date: |
Sat, 9 Nov 2024 13:14:27 +0300 |
From: TANG Tiancheng <tangtiancheng.ttc@alibaba-inc.com>
Ensure that riscv_cpu_sxl returns MXL_RV32 when runningRV32 in an
RV64 QEMU.
Signed-off-by: TANG Tiancheng <tangtiancheng.ttc@alibaba-inc.com>
Fixes: 05e6ca5e156 ("target/riscv: Ignore reserved bits in PTE for RV64")
Reviewed-by: Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240919055048.562-4-zhiwei_liu@linux.alibaba.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 929e4277c128772bad41cc795995f754cb9991af)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index d74b361be6..09f3acefcb 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -647,8 +647,11 @@ static inline RISCVMXL riscv_cpu_sxl(CPURISCVState *env)
#ifdef CONFIG_USER_ONLY
return env->misa_mxl;
#else
- return get_field(env->mstatus, MSTATUS64_SXL);
+ if (env->misa_mxl != MXL_RV32) {
+ return get_field(env->mstatus, MSTATUS64_SXL);
+ }
#endif
+ return MXL_RV32;
}
#endif
--
2.39.5
- [Stable-8.2.8 22/49] tcg: Reset data_gen_ptr correctly, (continued)
- [Stable-8.2.8 22/49] tcg: Reset data_gen_ptr correctly, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 24/49] target/i386: Use probe_access_full_mmu in ptw_translate, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 25/49] linux-user: Emulate /proc/self/maps under mmap_lock, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 27/49] vfio/migration: Report only stop-copy size in vfio_state_pending_exact(), Michael Tokarev, 2024/11/09
- [Stable-8.2.8 38/49] target/riscv: Set vtype.vill on CPU reset, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 35/49] target/riscv/csr.c: Fix an access to VXSAT, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 23/49] target/i386: Walk NPT in guest real mode, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 30/49] Fix calculation of minimum in colo_compare_tcp, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 34/49] target/arm: Fix arithmetic underflow in SETM instruction, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 31/49] net: fix build when libbpf is disabled, but libxdp is enabled, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 36/49] target/riscv: Correct SXL return value for RV32 in RV64 QEMU,
Michael Tokarev <=
- [Stable-8.2.8 40/49] hw/intc/riscv_aplic: Check and update pending when write sourcecfg, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 39/49] hw/intc/riscv_aplic: Fix in_clrip[x] read emulation, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 37/49] hw/intc: Don't clear pending bits on IRQ lowering, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 47/49] migration: Ensure vmstate_save() sets errp, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 29/49] dockerfiles: fix default targets for debian-loongarch-cross, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 42/49] target/riscv/kvm: clarify how 'riscv-aia' default works, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 46/49] target/arm: Fix SVE SDOT/UDOT/USDOT (4-way, indexed), Michael Tokarev, 2024/11/09
- [Stable-8.2.8 48/49] hw/nvme: fix handling of over-committed queues, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 49/49] 9pfs: fix crash on 'Treaddir' request, Michael Tokarev, 2024/11/09
- [Stable-8.2.8 41/49] target/riscv/kvm: set 'aia_mode' to default in error path, Michael Tokarev, 2024/11/09