Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp608384rdb; Thu, 1 Feb 2024 20:12:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgl4Gj2vGEh/ETvNPMgPKfDyqSbTle7HaVU134dpHE8Sba3RI0tBGSsVpEq4QK0vwF8HBl X-Received: by 2002:ac2:5e62:0:b0:50e:fd98:8ad0 with SMTP id a2-20020ac25e62000000b0050efd988ad0mr414381lfr.63.1706847153781; Thu, 01 Feb 2024 20:12:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706847153; cv=pass; d=google.com; s=arc-20160816; b=a7374i6rMn9b8TrTjGAvh8cuHVwgic/PvhDv4i5HMUt9xiO4T6fp64smEl/amH8Wr3 WBaUsfZcCE3WQxKFeqsUkcdK9v6maTIjiTpfzX+o2QZtpj4rX7lXjx78b+Oyf8dRl1nv AoUoihBIi+VnaF3En6ydQzhZBKGEdy/OuIKgIhgo2O2rkplCxrawGpT2ogc+L70tDIac s+3pBTovRLA2gvMT9EZR0C6pNxhF2pHFlMzhbIlq+623vXMP+lgdBIoFx3xTIY9hiv1f flOZxqs7mGhqmqcQBSO3NTCrSFi7hFQnK9r93QIRpDnIwER0Is0Gel9wHTn5AYHaY/Lg jOhQ== 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=HR8D4sJEMZ56Ni66pMBG4rdbI+wSTV+4Nk2pbAR/ToA=; fh=+vphdYz5tXA2GZZbcmr7iyi1Z3uoL7Y3JVVoJiFqSKE=; b=hqNuJ5KKq3wBAGf6/6kOPQaVCpa3ct8FYBVlRYtR0wyP9S6eZSz+bPclCA8PKSOvwF mZa+4g031ryuE5jR8nOngQkECLJm0L5+vaPjs/LQYR2lpoA6GF3a+vBGm348Y0O/Daa5 dfKnPmwtbh/n9hkLiTSO/MRk73UAW6e9UxbLir7Qfj5/8dAfYAOIRHoBZ+nFJq/0v6VP ISFmd2ejivL1/vwq6y4Q0Ia+KBThnt+BwemiVf2b+/vvynur5v+YRaoMytil0F0v2J6r Vt+Q9PYxusitqBqVapQRIHtcnckl9nqtSFvwKchL/pivT5np27lNGvGEp9vTft5bwrgn cLLg==; dara=google.com 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-49181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49181-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVBeOB2BvFI/QDBIZd8nKDBhhPT6zIroCpYrlWdT3dpj09UNdjFHmXLzEYI5irJ41ienA5JnS3GWu3AU5hSw8CXUaI5KiA8tISfmpkkvg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d16-20020a170906371000b00a298b1de849si411657ejc.648.2024.02.01.20.12.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 20:12:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=loongson.cn); spf=pass (google.com: domain of linux-kernel+bounces-49181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49181-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 498D81F21D3D for ; Fri, 2 Feb 2024 04:12:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 245B71754B; Fri, 2 Feb 2024 04:11:01 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3782F508; Fri, 2 Feb 2024 04:10:56 +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=1706847060; cv=none; b=dwEekKwrjNBk1V660Io7xXt+RDl6SBFR3zZYOzflaTkd/gCp8N2IvyRf2n6vJWBOrHDSC/rhFg7tM4MaZ/CmDTuNV3+Q2ZNwE9SUtjZKBKiSBpO3Ad7XAj4U/LJ1t08Jlu++7jZ7ozBt2+bE9P/XAT+mxVsK7UzFWCx8ZplcxvM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706847060; c=relaxed/simple; bh=LiOCyLFruOphupmn52/zjX6PXxgRWEIgzMpTYjIYNVc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mQgdXr+fWkNzO7smn1LO8rOY6Th8IQLwQNcur/y8/ylexjyQMBAw1/rXlnTC64JlO9fzc7kRkjRE89bOmBREstKFehtmJdL9MpaJNDUlpe+WYstUM4oDUE387jMrX+EFUGLKgj1BiNz8g74wttg2FjMlFXzIWs3dIBboE8tFQrA= 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 _____8DxaOhKa7xlcf4JAA--.9336S3; Fri, 02 Feb 2024 12:10:50 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxvhNGa7xlhd0sAA--.51008S6; Fri, 02 Feb 2024 12:10:49 +0800 (CST) From: Bibo Mao To: Paolo Bonzini , Sean Christopherson Cc: Tianrui Zhao , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v7 4/4] KVM: selftests: Add test cases for LoongArch Date: Fri, 2 Feb 2024 12:10:46 +0800 Message-Id: <20240202041046.3405779-5-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240202041046.3405779-1-maobibo@loongson.cn> References: <20240202041046.3405779-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:AQAAf8DxvhNGa7xlhd0sAA--.51008S6 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoWxZr4fAFy3XrWDWFyDtw1kWFX_yoW5AF1Upa 4xCryqvF48CFsrAr1fG34DXa1fGr97KrWIgFyfKw18ur93Jw1xJF1xKasrtFn5tw1rXwn0 v3WfKw17XaykAwbCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUcCD7UUUUU 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..fce54108fdc0 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__ || defined __loongarch__ supported_flags |= KVM_MEM_READONLY; #endif -- 2.39.3