From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 279B8C433EF for ; Thu, 14 Jul 2022 15:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mUs7i7qo1tPghEFmO82fFSs1YToZw/DYDOBsMnQNzrU=; b=ZEDRcCiqCHRc71 dsyGC6NfrrcNtq0dCoAsfv8wUXFmtRScth/YErFxu2PIskWybteDIokv1UimcGQORN83kYAH8gOT6 YQirljevJFpYF7Ok6dLCRIdvq3jc5cn2tvp1FyulStEwl5PYHjnbtOsQa/sufVGgL8zuWGnsMGqUy xYDArDDcOv+ibu/ufNtZGFs+1OTclZJTViS/VrZ3B3iftBVdgVxJfowIlqKO+HRHnO1fDafZmGhbC f+ybSrNHweFJzYYJNTTuo07CzCeoceVdIn3Gw/e6yyjWJs0vSJHntzfzzGTgYMcyjdw+9cu5yWDPp HJpvwVfgzaHukomZVVtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC15E-00Fu7o-0d; Thu, 14 Jul 2022 15:48:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC0xq-00FpXk-SF for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 15:41:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6A0EB61F5A; Thu, 14 Jul 2022 15:41:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAB38C341C8; Thu, 14 Jul 2022 15:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657813277; bh=KCci7Zc0Qe8DJO0od+8TvidaaIOOcDyEDf6L//1MnIM=; h=From:To:Cc:Subject:Date:From; b=MAWQIz2V3VT7z9NNgf/QdQgKf55qjyCy2Xk8RZ7CQ57P404/TWyNiu/Q4bgK56QR+ gQ/WfESMD5VEFTtFPE+HN3VmANQEHtivXI8h0w8jytnMoWi+ygLplB1SzdBdgYYtWH HICyUftjCz2xnsZ1hSEdqC1FqFdMVBbxEjjStQCvm2yKj9B2d3Q/Yn5a0qYZul/pix zzV9n25j3IzlfajpjcTpV7Byq1oYet4duxQb+O5vIGxT/zuovTUH3JjFfjRe9JBWMI 5wiklH9eb7MnE8DNjLALRbMmLb+LiNbFSenFha1PNDUxnWW3SmLE3vz7EhMktsyyLx xH6SSQh7P2Jdg== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oC0xn-007V0d-P5; Thu, 14 Jul 2022 16:41:15 +0100 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Alexandru Elisei , Oliver Upton , Ricardo Koller Subject: [PATCH] KVM: arm64: selftests: Add support for GICv2 on v3 Date: Thu, 14 Jul 2022 16:41:08 +0100 Message-Id: <20220714154108.3531213-1-maz@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, oliver.upton@linux.dev, ricarkol@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_084118_995851_E20D0E90 X-CRM114-Status: GOOD ( 15.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The current vgic_init test wrongly assumes that the host cannot multiple versions of the GIC architecture, while v2 emulation on v3 has almost always been supported (it was supported before the standalone v3 emulation). Tweak the test to support multiple GIC incarnations. Signed-off-by: Marc Zyngier --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c b/tools/testing/selftests/kvm/aarch64/vgic_init.c index 34379c98d2f4..21ba4002fc18 100644 --- a/tools/testing/selftests/kvm/aarch64/vgic_init.c +++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c @@ -670,7 +670,7 @@ int test_kvm_device(uint32_t gic_dev_type) if (!_kvm_create_device(v.vm, other, true, &fd)) { ret = _kvm_create_device(v.vm, other, false, &fd); - TEST_ASSERT(ret && errno == EINVAL, + TEST_ASSERT(ret && (errno == EINVAL || errno == EEXIST), "create GIC device while other version exists"); } @@ -698,6 +698,7 @@ int main(int ac, char **av) { int ret; int pa_bits; + int cnt_impl = 0; pa_bits = vm_guest_mode_params[VM_MODE_DEFAULT].pa_bits; max_phys_size = 1ULL << pa_bits; @@ -706,17 +707,19 @@ int main(int ac, char **av) if (!ret) { pr_info("Running GIC_v3 tests.\n"); run_tests(KVM_DEV_TYPE_ARM_VGIC_V3); - return 0; + cnt_impl++; } ret = test_kvm_device(KVM_DEV_TYPE_ARM_VGIC_V2); if (!ret) { pr_info("Running GIC_v2 tests.\n"); run_tests(KVM_DEV_TYPE_ARM_VGIC_V2); - return 0; + cnt_impl++; } - print_skip("No GICv2 nor GICv3 support"); - exit(KSFT_SKIP); + if (!cnt_impl) { + print_skip("No GICv2 nor GICv3 support"); + exit(KSFT_SKIP); + } return 0; } -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel