From nobody Tue Feb 10 16:02:00 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47C70254AE4; Tue, 20 May 2025 01:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747704604; cv=none; b=WCJhS2nJwSi4M1DaZBmsePK3Xwj5eAD+3Jn+lfunX8vfxzmnZ4Fl/QrnT5sGjtfSr+U6RZF5y7k6KA/pG8ekPhBAnx5k9tCEpD3RxMyEuT6aUycW/236XInjqeinGylD0CiVNVBpOCnLMRcBnEBctCtIdt0HG4KU/06RA3rmX5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747704604; c=relaxed/simple; bh=4549Z/en9noEXpUOOg5Z0n8G17pW2n28/exB5AwF5IE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ggbr+V43fZMUZNQyKbAsp5vVrkxsC0uELy0lBxRnmDzsFK4Ypo43rDImCVMr7TKVoXjPDExEBycxy9Nf6o+wmj0Y3c/icmw8xTXQqKj5qs48NKZJrC2NTRnmtcMidx4i3RywURrLmadTXNZwLJB4o38D2PkGI115pWap8gv8MS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.2.5.213]) by gateway (Coremail) with SMTP id _____8DxbKwY2ytoaczyAA--.65172S3; Tue, 20 May 2025 09:30:00 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by front1 (Coremail) with SMTP id qMiowMDxPcUS2ytoy1ziAA--.54307S7; Tue, 20 May 2025 09:29:59 +0800 (CST) From: Bibo Mao To: Paolo Bonzini , Huacai Chen , Sean Christopherson Cc: Shuah Khan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Huacai Chen Subject: [PATCH v12 5/5] KVM: selftests: Add supported test cases for LoongArch Date: Tue, 20 May 2025 09:29:54 +0800 Message-Id: <20250520012954.1785088-6-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20250520012954.1785088-1-maobibo@loongson.cn> References: <20250520012954.1785088-1-maobibo@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowMDxPcUS2ytoy1ziAA--.54307S7 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Huacai Chen --- MAINTAINERS | 2 ++ tools/testing/selftests/kvm/Makefile | 2 +- tools/testing/selftests/kvm/Makefile.kvm | 17 +++++++++++++++++ .../selftests/kvm/set_memory_region_test.c | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index d48dd6726fe6..369da62e4837 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13051,6 +13051,8 @@ F: Documentation/virt/kvm/loongarch/ F: arch/loongarch/include/asm/kvm* F: arch/loongarch/include/uapi/asm/kvm* F: arch/loongarch/kvm/ +F: tools/testing/selftests/kvm/*/loongarch/ +F: tools/testing/selftests/kvm/lib/loongarch/ =20 KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips) M: Huacai Chen diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests= /kvm/Makefile index 20af35a91d6f..d9fffe06d3ea 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -3,7 +3,7 @@ top_srcdir =3D ../../../.. include $(top_srcdir)/scripts/subarch.include ARCH ?=3D $(SUBARCH) =20 -ifeq ($(ARCH),$(filter $(ARCH),arm64 s390 riscv x86 x86_64)) +ifeq ($(ARCH),$(filter $(ARCH),arm64 s390 riscv x86 x86_64 loongarch)) # Top-level selftests allows ARCH=3Dx86_64 :-( ifeq ($(ARCH),x86_64) ARCH :=3D x86 diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selft= ests/kvm/Makefile.kvm index f62b0a5aba35..854de8089ab4 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -47,6 +47,10 @@ LIBKVM_riscv +=3D lib/riscv/handlers.S LIBKVM_riscv +=3D lib/riscv/processor.c LIBKVM_riscv +=3D lib/riscv/ucall.c =20 +LIBKVM_loongarch +=3D lib/loongarch/processor.c +LIBKVM_loongarch +=3D lib/loongarch/ucall.c +LIBKVM_loongarch +=3D lib/loongarch/exception.S + # Non-compiled test targets TEST_PROGS_x86 +=3D x86/nx_huge_pages_test.sh =20 @@ -190,6 +194,19 @@ TEST_GEN_PROGS_riscv +=3D coalesced_io_test TEST_GEN_PROGS_riscv +=3D get-reg-list TEST_GEN_PROGS_riscv +=3D steal_time =20 +TEST_GEN_PROGS_loongarch +=3D coalesced_io_test +TEST_GEN_PROGS_loongarch +=3D demand_paging_test +TEST_GEN_PROGS_loongarch +=3D dirty_log_perf_test +TEST_GEN_PROGS_loongarch +=3D dirty_log_test +TEST_GEN_PROGS_loongarch +=3D guest_print_test +TEST_GEN_PROGS_loongarch +=3D hardware_disable_test +TEST_GEN_PROGS_loongarch +=3D kvm_binary_stats_test +TEST_GEN_PROGS_loongarch +=3D kvm_create_max_vcpus +TEST_GEN_PROGS_loongarch +=3D kvm_page_table_test +TEST_GEN_PROGS_loongarch +=3D memslot_modification_stress_test +TEST_GEN_PROGS_loongarch +=3D memslot_perf_test +TEST_GEN_PROGS_loongarch +=3D set_memory_region_test + SPLIT_TESTS +=3D arch_timer SPLIT_TESTS +=3D get-reg-list =20 diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/t= esting/selftests/kvm/set_memory_region_test.c index bc440d5aba57..ce3ac0fd6dfb 100644 --- a/tools/testing/selftests/kvm/set_memory_region_test.c +++ b/tools/testing/selftests/kvm/set_memory_region_test.c @@ -350,7 +350,7 @@ static void test_invalid_memory_region_flags(void) struct kvm_vm *vm; int r, i; =20 -#if defined __aarch64__ || defined __riscv || defined __x86_64__ +#if defined __aarch64__ || defined __riscv || defined __x86_64__ || define= d __loongarch__ supported_flags |=3D KVM_MEM_READONLY; #endif =20 --=20 2.39.3