Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1483223rdb; Wed, 24 Jan 2024 17:55:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBgk5gFDK23DD+/gfkf9/m+pVRnKbndscP4J3rE2lkw6qqZFvU8qm4BvIJ4RrWroeSABWR X-Received: by 2002:a05:6808:1294:b0:3bd:cbf2:8f09 with SMTP id a20-20020a056808129400b003bdcbf28f09mr215727oiw.16.1706147747150; Wed, 24 Jan 2024 17:55:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706147747; cv=pass; d=google.com; s=arc-20160816; b=ii0LXcMGWkph9vk3dq2MlZMF1D3Fk+vwXJTeys9D0oZlR94quZGP+fkZmbx+KwRCxO Pwq9r6a7ZR95Wpq3Edc8MDsR9kWV6+X1cs2gTkxD2IyL/IZlqlUGLKpV2K+TlPEnCyLO gEr9RuI3bvQeD7mttpLbeQkfbj6BbAPfB8lAKIQTGYFe/KUx/CBTsw5vTd7JL9qT3h6R avxh4gWfqHRK1AorNqkV5HdQ36rCVipGzcYhi1FBIqB+mHYj/Z8efpPIwqEP9piFAbSc KydkxlAL3HNIl3ZL6zNk7s9QL6zlOc3aQm4gqXoZb06msQkbRBuT2Bl68+Qc9iyXXJaM SnIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Doi7v4we5D7PV+6iZRCnSV0ieoohs2kRpR8gzzHqwqY=; fh=wle3M6nZSpyM2bErweAAS2C2D0e+rFxFslIQG1wEa/g=; b=eCLR10ApjyqXIVXlCxE1a345hiTlPslNfjhc0DAvwX2GuwnV5chtXGkz1+tDl4KhRL O0PJfLv8CigL3zKE5Xsos4Zn5hvhNiHoeja6cIUzG4hkkNmG+DZ3C3RQNr1vFb1KmGph 6hxhZOLCbqwS3EKakbQllY4f86jyb8ldfXD5vFOPYVeuzfxl4p6BjXjSjHwXnRwowdTp b+s4w2uwRj42wA5/EpwNSUfTRCal9Tpg+swmYHlnOpwvuf5kPmkIAkXgQeSniSBxOPfv b7fFi/ffhxeK8fDucIJEdWfpOb+f/zrwE8yQAELIH2mPd7kN7LKpmfOyV9UZY895t6/T e5iA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=loongson.cn); spf=pass (google.com: domain of linux-kernel+bounces-37878-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37878-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n50-20020a056a000d7200b006dd7cc23eabsi3392585pfv.115.2024.01.24.17.55.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 17:55:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37878-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=loongson.cn); spf=pass (google.com: domain of linux-kernel+bounces-37878-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37878-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C2A1C283394 for ; Thu, 25 Jan 2024 01:55:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0B28F51F; Thu, 25 Jan 2024 01:54:35 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E19A96FD1; Thu, 25 Jan 2024 01:54:32 +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=1706147675; cv=none; b=fFTyljvCtTaFJFAOZmuyoDyhru1pMOrS1lgyqoY3rnH9Q0+ko5kkA35r4H7GCnoLm9wBN2OEQA8u3SmthPiOpqdOusv587y4juFE76Zfybpdl2z9WfHcgIaQ/oQKOqun7q93ZnzbSVNlihulN1KNXN8LDKJwzJB6IvpFyw19Ras= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706147675; c=relaxed/simple; bh=Gd1Cx3E2E6sNmeQ8ukkg3HzkbrvNLJAwqO0BOOvV/s8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C9GGEcIZl46uB9E2ygg0hLxw3vgdQes8p0/B1rKLu1DhPMC+i+2V2w4rbks0znNp+akyyeqyThZrpBAbvQRuYyqn+bT5XO0XWCa+K2nwgpl/k4XgosU+S5yJgT0T5CE0b2p1tq+7A6fmc/Zd9+QddCyLsRUxjxiGBYUeRZEpnsI= 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 _____8BxuvBXv7Fltj0FAA--.20271S3; Thu, 25 Jan 2024 09:54:31 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxVMxMv7FlojkYAA--.45641S6; Thu, 25 Jan 2024 09:54:30 +0800 (CST) From: Bibo Mao To: Paolo Bonzini , Shuah Khan , Sean Christopherson Cc: Tianrui Zhao , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v6 4/4] KVM: selftests: Add test cases for LoongArch Date: Thu, 25 Jan 2024 09:54:20 +0800 Message-Id: <20240125015420.1960090-5-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240125015420.1960090-1-maobibo@loongson.cn> References: <20240125015420.1960090-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: 8bit X-CM-TRANSID:AQAAf8BxVMxMv7FlojkYAA--.45641S6 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoWxZr4fAFy3XrWDWFyDtw1kWFX_yoW5ArWrpa 4xCryqvF48CFsrAr1fG34kZa1fGr97KrWIgFyfKw18ur93Jw1xJF1xKasrtFnYk34rXwnI v3WfKw17WaykAwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU90b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAaw2AFwI0_Jrv_JF1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_ WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwI xGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km07C267AKxVWU XVWUAwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67 kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY 6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0x vEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVj vjDU0xZFpf9x07jz2NtUUUUU= From: Tianrui Zhao Some common KVM testcases are supported on LoongArch now as following: 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 neither. Signed-off-by: Tianrui Zhao Signed-off-by: Bibo Mao --- tools/testing/selftests/kvm/Makefile | 16 ++++++++++++++++ .../selftests/kvm/set_memory_region_test.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 492e937fab00..0261c87b0bb3 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -56,6 +56,10 @@ LIBKVM_s390x += lib/s390x/ucall.c LIBKVM_riscv += lib/riscv/processor.c LIBKVM_riscv += lib/riscv/ucall.c +LIBKVM_loongarch += lib/loongarch/processor.c +LIBKVM_loongarch += lib/loongarch/ucall.c +LIBKVM_loongarch += lib/loongarch/exception.S + # Non-compiled test targets TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh @@ -196,6 +200,18 @@ TEST_GEN_PROGS_riscv += steal_time SPLIT_TESTS += get-reg-list +TEST_GEN_PROGS_loongarch += demand_paging_test +TEST_GEN_PROGS_loongarch += dirty_log_perf_test +TEST_GEN_PROGS_loongarch += dirty_log_test +TEST_GEN_PROGS_loongarch += guest_print_test +TEST_GEN_PROGS_loongarch += hardware_disable_test +TEST_GEN_PROGS_loongarch += kvm_binary_stats_test +TEST_GEN_PROGS_loongarch += kvm_create_max_vcpus +TEST_GEN_PROGS_loongarch += kvm_page_table_test +TEST_GEN_PROGS_loongarch += memslot_modification_stress_test +TEST_GEN_PROGS_loongarch += memslot_perf_test +TEST_GEN_PROGS_loongarch += set_memory_region_test + TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR)) TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR)) TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR)) diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c index 075b80dbe237..7b09e59296be 100644 --- a/tools/testing/selftests/kvm/set_memory_region_test.c +++ b/tools/testing/selftests/kvm/set_memory_region_test.c @@ -333,7 +333,7 @@ static void test_invalid_memory_region_flags(void) struct kvm_vm *vm; int r, i; -#if defined __aarch64__ || defined __x86_64__ +#if defined __aarch64__ || defined __x86_64__ || __loongarch__ supported_flags |= KVM_MEM_READONLY; #endif -- 2.39.3