KVM: riscv: selftests: sv39 support needed? 

Andrew Jones ajones at ventanamicro.com
Thu Sep 18 07:13:14 PDT 2025


On Wed, Sep 17, 2025 at 10:11:05AM +0800, wu.fei9 at sanechips.com.cn wrote:
> I was running kvm selftests on qemu-system-riscv64 with "-cpu rva23s64", which
> uses sv39 by default, then I got the following error. After some debugging I
> found sv39 is not supported for selftests, should we add sv39 support? I can
> prepare a patch if it's needed.

Yes, please.

> 
> # ./arch_timer
> Random seed: 0x6b8b4567
> ==== Test Assertion Failure ====
>   arch_timer.c:73: false
>   pid=144 tid=146 errno=0 - Success

We can avoid errors for the default case by adding a
kvm_selftest_arch_init() function for riscv which calls
guest_modes_append_default(). We'll also need to modify
guest_modes_append_default() to configure the default using information
from KVM that can be obtained with a get-one-reg of the satp_mode config
register. OIOW, use satp_mode but otherwise just mimic arm64's setup.

Thanks,
drew



More information about the kvm-riscv mailing list