mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/riscv: Add max32 CPU for RV64 QEMU
We may need 32-bit max for RV64 QEMU. Thus we add these two CPUs for RV64 QEMU. The reason we don't expose them to RV32 QEMU is that we already have max cpu with the same configuration. Another reason is that we want to follow the RISC-V custom where addw instruction doesn't exist in RV32 CPU. Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Suggested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-ID: <20240919055048.562-8-zhiwei_liu@linux.alibaba.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
e087bd4de3
commit
48cea772c3
2 changed files with 8 additions and 5 deletions
|
@ -449,11 +449,9 @@ static void riscv_max_cpu_init(Object *obj)
|
|||
|
||||
env->priv_ver = PRIV_VERSION_LATEST;
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
#ifdef TARGET_RISCV32
|
||||
set_satp_mode_max_supported(cpu, VM_1_10_SV32);
|
||||
#else
|
||||
set_satp_mode_max_supported(cpu, VM_1_10_SV57);
|
||||
#endif
|
||||
set_satp_mode_max_supported(RISCV_CPU(obj),
|
||||
riscv_cpu_mxl(&RISCV_CPU(obj)->env) == MXL_RV32 ?
|
||||
VM_1_10_SV32 : VM_1_10_SV57);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2959,6 +2957,10 @@ static const TypeInfo riscv_cpu_type_infos[] = {
|
|||
DEFINE_BARE_CPU(TYPE_RISCV_CPU_RV32E, MXL_RV32, rv32e_bare_cpu_init),
|
||||
#endif
|
||||
|
||||
#if (defined(TARGET_RISCV64) && !defined(CONFIG_USER_ONLY))
|
||||
DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX32, MXL_RV32, riscv_max_cpu_init),
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_RISCV64)
|
||||
DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE64, MXL_RV64, rv64_base_cpu_init),
|
||||
DEFINE_VENDOR_CPU(TYPE_RISCV_CPU_SIFIVE_E51, MXL_RV64, rv64_sifive_e_cpu_init),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue