KVM: riscv: selftests: sv39 support needed?
Wu Fei
atwufei at 163.com
Thu Oct 9 05:40:03 PDT 2025
On 9/18/25 22:13, Andrew Jones wrote:
> 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.
Should we add another mode as VM_MODE_P41V39_4K? The smallest VA is
47bits on the existing modes.
Also, is it necessary to add mode for sv57? Or we can just use some
existing ones such as P52V48 instead.
>
>> # ./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.
Is the current kvm_check_cap(KVM_CAP_VM_GPA_BITS) equal to satp_mode,
e.g. gpa 41-bits always means 8 in satp_mode?
Thanks,
Fei.
>
> Thanks,
> drew
>
More information about the kvm-riscv
mailing list