riscv: Call set_satp_mode_max_supported in riscv_host_cpu_init
PATCH 1/1 riscv: Call set_satp_mode_max_supported in riscv_host_cpu_init
When running in KVM mode with -cpu host, cfg.satp_mode.supported is not initialized, causing an infinite loop in riscv_cpu_satp_mode_finalize.
Fixes 6df3747a27 ("riscv: Introduce satp mode hw capabilities")
Signed-off-by Andreas Schwab <[email protected]>
--- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+)
target/riscv/cpu.c +2 -0
@@ -623,8 +623,10 @@ static void riscv_host_cpu_init(Object *obj)CPURISCVState *env = &RISCV_CPU (obj)->env;#if defined(TARGET_RISCV32 )set_misa (env,MXL_RV32 ,0 ); +set_satp_mode_max_supported (RISCV_CPU (obj),VM_1_10_SV32 );#elif defined(TARGET_RISCV64 )set_misa (env,MXL_RV64 ,0 ); +set_satp_mode_max_supported (RISCV_CPU (obj),VM_1_10_SV57 );#endif riscv_cpu_add_user_properties (obj); }
Signature · 7 lines
2.42.0 -- Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Quoted 27 lines · Andreas Schwab
When running in KVM mode with -cpu host, cfg.satp_mode.supported is not initialized, causing an infinite loop in
riscv_cpu_satp_mode_finalize.Fixes 6df3747a27 ("riscv: Introduce satp mode hw capabilities")Signed-off-by Andreas Schwab <[email protected]>--- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+)target/riscv/cpu.c +2
-0@@ -623,8 +623,10 @@ static void riscv_host_cpu_init(Object *obj)CPURISCVState *env = &RISCV_CPU (obj)->env;#if defined(TARGET_RISCV32 )set_misa (env,MXL_RV32 ,0 ); +set_satp_mode_max_supported (RISCV_CPU (obj),VM_1_10_SV32 );#elif defined(TARGET_RISCV64 )set_misa (env,MXL_RV64 ,0 ); +set_satp_mode_max_supported (RISCV_CPU (obj),VM_1_10_SV57 );#endif riscv_cpu_add_user_properties (obj); }Signature · 1 line
2.42.0
This should be fixed by
https://lore.kernel.org/all/[email protected]/
Thanks,
drew
Quoted 3 lines · Andrew Jones
This should be fixed by
Thanks, I can confirm that it fixes the issue.
Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."