KVM: selftests: Add initial support for RISC-V 64-bit
authorAnup Patel <anup.patel@wdc.com>
Tue, 5 Oct 2021 12:39:56 +0000 (18:09 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 6 Jan 2022 09:47:50 +0000 (15:17 +0530)
commit3e06cdf10520e629e711b76b21070d6e67ae7d06
tree10899ef656b600aa40833bcf241cb3470db9c47f
parent788490e798a707cea75d80448f5c6c5f322ada6e
KVM: selftests: Add initial support for RISC-V 64-bit

We add initial support for RISC-V 64-bit in KVM selftests using
which we can cross-compile and run arch independent tests such as:
demand_paging_test
dirty_log_test
kvm_create_max_vcpus,
kvm_page_table_test
set_memory_region_test
kvm_binary_stats_test

All VM guest modes defined in kvm_util.h require at least 48-bit
guest virtual address so to use KVM RISC-V selftests hardware
need to support at least Sv48 MMU for guest (i.e. VS-mode).

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-and-tested-by: Atish Patra <atishp@rivosinc.com>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/include/riscv/processor.h [new file with mode: 0644]
tools/testing/selftests/kvm/lib/guest_modes.c
tools/testing/selftests/kvm/lib/riscv/processor.c [new file with mode: 0644]
tools/testing/selftests/kvm/lib/riscv/ucall.c [new file with mode: 0644]