Skip to content

Commit a867688

Browse files
bibo-maochenhuacai
authored andcommitted
KVM: selftests: Add supported test cases for LoongArch
Some common KVM test cases are supported on LoongArch now as following: coalesced_io_test demand_paging_test dirty_log_perf_test dirty_log_test guest_print_test hardware_disable_test kvm_binary_stats_test kvm_create_max_vcpus kvm_page_table_test memslot_modification_stress_test memslot_perf_test set_memory_region_test And other test cases are not supported by LoongArch such as rseq_test, since it is not supported on LoongArch physical machine either. Signed-off-by: Bibo Mao <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 304b93b commit a867688

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13051,6 +13051,8 @@ F: Documentation/virt/kvm/loongarch/
1305113051
F: arch/loongarch/include/asm/kvm*
1305213052
F: arch/loongarch/include/uapi/asm/kvm*
1305313053
F: arch/loongarch/kvm/
13054+
F: tools/testing/selftests/kvm/*/loongarch/
13055+
F: tools/testing/selftests/kvm/lib/loongarch/
1305413056

1305513057
KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)
1305613058
M: Huacai Chen <[email protected]>

tools/testing/selftests/kvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ top_srcdir = ../../../..
33
include $(top_srcdir)/scripts/subarch.include
44
ARCH ?= $(SUBARCH)
55

6-
ifeq ($(ARCH),$(filter $(ARCH),arm64 s390 riscv x86 x86_64))
6+
ifeq ($(ARCH),$(filter $(ARCH),arm64 s390 riscv x86 x86_64 loongarch))
77
# Top-level selftests allows ARCH=x86_64 :-(
88
ifeq ($(ARCH),x86_64)
99
ARCH := x86

tools/testing/selftests/kvm/Makefile.kvm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ LIBKVM_riscv += lib/riscv/handlers.S
4747
LIBKVM_riscv += lib/riscv/processor.c
4848
LIBKVM_riscv += lib/riscv/ucall.c
4949

50+
LIBKVM_loongarch += lib/loongarch/processor.c
51+
LIBKVM_loongarch += lib/loongarch/ucall.c
52+
LIBKVM_loongarch += lib/loongarch/exception.S
53+
5054
# Non-compiled test targets
5155
TEST_PROGS_x86 += x86/nx_huge_pages_test.sh
5256

@@ -190,6 +194,19 @@ TEST_GEN_PROGS_riscv += coalesced_io_test
190194
TEST_GEN_PROGS_riscv += get-reg-list
191195
TEST_GEN_PROGS_riscv += steal_time
192196

197+
TEST_GEN_PROGS_loongarch += coalesced_io_test
198+
TEST_GEN_PROGS_loongarch += demand_paging_test
199+
TEST_GEN_PROGS_loongarch += dirty_log_perf_test
200+
TEST_GEN_PROGS_loongarch += dirty_log_test
201+
TEST_GEN_PROGS_loongarch += guest_print_test
202+
TEST_GEN_PROGS_loongarch += hardware_disable_test
203+
TEST_GEN_PROGS_loongarch += kvm_binary_stats_test
204+
TEST_GEN_PROGS_loongarch += kvm_create_max_vcpus
205+
TEST_GEN_PROGS_loongarch += kvm_page_table_test
206+
TEST_GEN_PROGS_loongarch += memslot_modification_stress_test
207+
TEST_GEN_PROGS_loongarch += memslot_perf_test
208+
TEST_GEN_PROGS_loongarch += set_memory_region_test
209+
193210
SPLIT_TESTS += arch_timer
194211
SPLIT_TESTS += get-reg-list
195212

tools/testing/selftests/kvm/set_memory_region_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static void test_invalid_memory_region_flags(void)
350350
struct kvm_vm *vm;
351351
int r, i;
352352

353-
#if defined __aarch64__ || defined __riscv || defined __x86_64__
353+
#if defined __aarch64__ || defined __riscv || defined __x86_64__ || defined __loongarch__
354354
supported_flags |= KVM_MEM_READONLY;
355355
#endif
356356

0 commit comments

Comments
 (0)