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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FEC3C43334 for ; Thu, 14 Jul 2022 18:30:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F34DE4C489; Thu, 14 Jul 2022 14:30:26 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CWiYFzbUCtKe; Thu, 14 Jul 2022 14:30:25 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D1E1A4C499; Thu, 14 Jul 2022 14:30:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 666B84C499 for ; Thu, 14 Jul 2022 14:30:24 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tk3SdX6+iSUj for ; Thu, 14 Jul 2022 14:30:23 -0400 (EDT) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 3F47E4C46F for ; Thu, 14 Jul 2022 14:30:23 -0400 (EDT) Received: by mail-pf1-f176.google.com with SMTP id y9so2579535pff.12 for ; Thu, 14 Jul 2022 11:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4BAm5Ap7NEHod+fAr+PGt31kGD7Q/EnOAXwYki9v/5c=; b=BCA39DCEAsKOKGBaqJR+l3QYfsmgwCJi40VgRFZwur6EN97IC7Kg8h2PQiyvtVNJpo wVF+zEhTF4MR3XQFSuVQ1vLJFSdPbLxr6Ej2tyO+cP5ckyNqDiydQD1Zgm6BkMcWJ5LR Z0SFYl7hsMAIyo/CMkAvPa2fT8Q0KMiiQHHG3RaPXVfWzzvgvNeJQ4fk/9L2OMC8OZ8A 3fBoWitDcLIJnYHWfjkdr+6Xz1c9CueCZ3sMoEWzA2CtVvQea+Ct6fEo6+yQop59R5RN /1sc7hXyTwlL25l9n279LRiby4xwLFS2vzgNvgAAK+/KsrBFdbROM7wDRqcIzsFnPqD5 T4iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4BAm5Ap7NEHod+fAr+PGt31kGD7Q/EnOAXwYki9v/5c=; b=7mFfBLq8NqNpDwk8qjQG/luRaYcZmEydTJu0X57oVdlbvuxZ9Z673quPX6QA1kt3cC SiwFc+Ncfobs0ebs5//GIqz9TBHFWbb1GDAFNQJKNWrVzS+/F2LmeK8bJc5dLfzlOmft du11YkpVUSkCZY4MB2cnVLEk+egDIfB9V1bKTG6hMPuouNzKpH9rgsLO3wK5xMvCCH5z Unvsk6F8LcjBAvXh4eHtDq/Cnbn5qcSAMfmj+ajWjlqCrd6oJlanXBupavQ75iCZyvzT ghkppEke1DBYrjnrM5eT7/q5GUU1FNWVNVMS8Pzs+W16bwdeSrcNps/pGpZXHyIMsbAh hTVA== X-Gm-Message-State: AJIora+yj7veHHlIgS3Q5dj3kcroScRT0OTFALwe5OWwJwKHJjA6yZrU k+okA39tZoTK7O0tnnpj6sV6Jw== X-Google-Smtp-Source: AGRyM1sjxrHT/mbe4M8hvqrXQIDM4yXuUm7dhZKaRkKzb3JLGDowQCkR2H1I24UmOaD7DJvIAA+U9Q== X-Received: by 2002:a05:6a00:2481:b0:52a:d50e:e75e with SMTP id c1-20020a056a00248100b0052ad50ee75emr9845998pfv.43.1657823422034; Thu, 14 Jul 2022 11:30:22 -0700 (PDT) Received: from google.com (150.12.83.34.bc.googleusercontent.com. [34.83.12.150]) by smtp.gmail.com with ESMTPSA id 186-20020a6214c3000000b0052ae3bcb807sm2009028pfu.188.2022.07.14.11.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 11:30:21 -0700 (PDT) Date: Thu, 14 Jul 2022 11:30:17 -0700 From: Ricardo Koller To: Marc Zyngier Subject: Re: [PATCH] KVM: arm64: selftests: Add support for GICv2 on v3 Message-ID: References: <20220714154108.3531213-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220714154108.3531213-1-maz@kernel.org> Cc: kvm@vger.kernel.org, Oliver Upton , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Marc, On Thu, Jul 14, 2022 at 04:41:08PM +0100, Marc Zyngier wrote: > 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). Thanks for the fix. This was my mistake (also I was taking too long to send the fix). > > Tweak the test to support multiple GIC incarnations. > Nit. You could add a fixes tag: Fixes: 3f4db37e203b ("KVM: arm64: selftests: Make vgic_init gic version agnostic") > 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 > Reviewed-by: Ricardo Koller _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 4D5EBC433EF for ; Thu, 14 Jul 2022 18:31:45 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t5DDA7XLjeodFjE2k8ATtvt3Wpcqc7Zi3eJSn4pNZwg=; b=DsH7mtDbrciZl4 np19n9Y2zu0knUxAnZMjDa4MQEZ4Gz+2u1zIVudu674faRCrKxaQFUVDj+AEgrutKbp7AdEnyjlho 4XtTL2pHeBUuwR7Gk2ioenigeRSo85lmzAKPbIkLmWy/kT0h4sCPocGhsFvycfZsI967ZGdqvbanC cJm5+A9BiZpZLgAHAVUqDZJSAOZwX745fhF5fx792bfEqQs5xC9pYO/O6H6IXfrhUorJntEEgN9+c 6f3QyWrwW/jVBm1tuDbWqeUiYu/bhmlj8QNvlXP2cwnIbeX4Wu0+Hdm/svUX2G6dYYvRl8lf/uAte nEVwmRqFIbfMSfjYOSUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC3bZ-00HBGZ-R0; Thu, 14 Jul 2022 18:30:29 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC3bX-00HBDi-6y for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 18:30:28 +0000 Received: by mail-pf1-x436.google.com with SMTP id o12so2602758pfp.5 for ; Thu, 14 Jul 2022 11:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4BAm5Ap7NEHod+fAr+PGt31kGD7Q/EnOAXwYki9v/5c=; b=BCA39DCEAsKOKGBaqJR+l3QYfsmgwCJi40VgRFZwur6EN97IC7Kg8h2PQiyvtVNJpo wVF+zEhTF4MR3XQFSuVQ1vLJFSdPbLxr6Ej2tyO+cP5ckyNqDiydQD1Zgm6BkMcWJ5LR Z0SFYl7hsMAIyo/CMkAvPa2fT8Q0KMiiQHHG3RaPXVfWzzvgvNeJQ4fk/9L2OMC8OZ8A 3fBoWitDcLIJnYHWfjkdr+6Xz1c9CueCZ3sMoEWzA2CtVvQea+Ct6fEo6+yQop59R5RN /1sc7hXyTwlL25l9n279LRiby4xwLFS2vzgNvgAAK+/KsrBFdbROM7wDRqcIzsFnPqD5 T4iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4BAm5Ap7NEHod+fAr+PGt31kGD7Q/EnOAXwYki9v/5c=; b=ZhjI5VIGuDwo8Jn5j/GbKcdTo2zNGByZA2Xr+EZAzxc/eHapz0ly/4Rt99f04yo2Cs O4S7n/xDAg8jMdw9ucKjHhsznfxq/KxVev6b2W79Dmt3NfVB2cZJFlRauzXqBOnauz3b WeSplvbml64r1SblN4lFFxh4q8+j6VBcG8nT+3qttbZwpsUepYf6kmdDqA2VBNZhZrUG C7Ar6zsHIWvv6mAZjr0rNeuh3RzjpFtSCIo6Nt6R6oMUjV6BwbX/p7xVI94q3SO/At09 90GP3+JVJFBZrr0G4UrXCPrYKRNdpxI8LS7pm3YvKYDxjx9tlm7z1uIMoEXBPy0E0l0L x5iQ== X-Gm-Message-State: AJIora/Y6aye6hq1tGZp+koKHaK0MikBqFnDL047IZg44RRNm2PtFJg1 v9H0Lb3K9QzIPrEF3VC5kLfZ+A== X-Google-Smtp-Source: AGRyM1sjxrHT/mbe4M8hvqrXQIDM4yXuUm7dhZKaRkKzb3JLGDowQCkR2H1I24UmOaD7DJvIAA+U9Q== X-Received: by 2002:a05:6a00:2481:b0:52a:d50e:e75e with SMTP id c1-20020a056a00248100b0052ad50ee75emr9845998pfv.43.1657823422034; Thu, 14 Jul 2022 11:30:22 -0700 (PDT) Received: from google.com (150.12.83.34.bc.googleusercontent.com. [34.83.12.150]) by smtp.gmail.com with ESMTPSA id 186-20020a6214c3000000b0052ae3bcb807sm2009028pfu.188.2022.07.14.11.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 11:30:21 -0700 (PDT) Date: Thu, 14 Jul 2022 11:30:17 -0700 From: Ricardo Koller To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Alexandru Elisei , Oliver Upton Subject: Re: [PATCH] KVM: arm64: selftests: Add support for GICv2 on v3 Message-ID: References: <20220714154108.3531213-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220714154108.3531213-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_113027_276835_B8272A85 X-CRM114-Status: GOOD ( 21.80 ) 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 Hi Marc, On Thu, Jul 14, 2022 at 04:41:08PM +0100, Marc Zyngier wrote: > 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). Thanks for the fix. This was my mistake (also I was taking too long to send the fix). > > Tweak the test to support multiple GIC incarnations. > Nit. You could add a fixes tag: Fixes: 3f4db37e203b ("KVM: arm64: selftests: Make vgic_init gic version agnostic") > 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 > Reviewed-by: Ricardo Koller _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D861DC43334 for ; Thu, 14 Jul 2022 18:30:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240745AbiGNSaf (ORCPT ); Thu, 14 Jul 2022 14:30:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240688AbiGNSaX (ORCPT ); Thu, 14 Jul 2022 14:30:23 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A86876B741 for ; Thu, 14 Jul 2022 11:30:22 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id f11so2325586pgj.7 for ; Thu, 14 Jul 2022 11:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4BAm5Ap7NEHod+fAr+PGt31kGD7Q/EnOAXwYki9v/5c=; b=BCA39DCEAsKOKGBaqJR+l3QYfsmgwCJi40VgRFZwur6EN97IC7Kg8h2PQiyvtVNJpo wVF+zEhTF4MR3XQFSuVQ1vLJFSdPbLxr6Ej2tyO+cP5ckyNqDiydQD1Zgm6BkMcWJ5LR Z0SFYl7hsMAIyo/CMkAvPa2fT8Q0KMiiQHHG3RaPXVfWzzvgvNeJQ4fk/9L2OMC8OZ8A 3fBoWitDcLIJnYHWfjkdr+6Xz1c9CueCZ3sMoEWzA2CtVvQea+Ct6fEo6+yQop59R5RN /1sc7hXyTwlL25l9n279LRiby4xwLFS2vzgNvgAAK+/KsrBFdbROM7wDRqcIzsFnPqD5 T4iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4BAm5Ap7NEHod+fAr+PGt31kGD7Q/EnOAXwYki9v/5c=; b=4vCX8sT4gapck1abUgTdDoSogVv5FZV9zQKvyL+q/mFtMmN+dL4005jHK2SVzdiPpx wJJ0c10BCY/+X88/EYoxGCCQ7xI7R7YS7vbzIMW4wXCWSJQWVVldtg0z9JWbG2GAoAR0 MmaS25cP5VoiMUt4nSsBe3G6PQblJ3J9LfRePlW2+3Esg9YAnASXaFF4XAoNq8kk9V16 E6/NTaf1jKrktR2GT5PBuWI3o0nlNMhNi4qLnJGNM1tjwFvGrckhKaVpB7YNgsgx1Cdp M6iJNz5/RciZLXWWOKgFir/Th6bdMwhH88J2wVqKkgf4YriSo98Z0YpHGBqeQ112PDJi mmEQ== X-Gm-Message-State: AJIora+AbZFje9IcaXWtyMN4ClkufnY921VGIYK6p4lEPp83p6228Nt2 6kjYI8IFrk5nw8EY1GYyyIri+w== X-Google-Smtp-Source: AGRyM1sjxrHT/mbe4M8hvqrXQIDM4yXuUm7dhZKaRkKzb3JLGDowQCkR2H1I24UmOaD7DJvIAA+U9Q== X-Received: by 2002:a05:6a00:2481:b0:52a:d50e:e75e with SMTP id c1-20020a056a00248100b0052ad50ee75emr9845998pfv.43.1657823422034; Thu, 14 Jul 2022 11:30:22 -0700 (PDT) Received: from google.com (150.12.83.34.bc.googleusercontent.com. [34.83.12.150]) by smtp.gmail.com with ESMTPSA id 186-20020a6214c3000000b0052ae3bcb807sm2009028pfu.188.2022.07.14.11.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 11:30:21 -0700 (PDT) Date: Thu, 14 Jul 2022 11:30:17 -0700 From: Ricardo Koller To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Alexandru Elisei , Oliver Upton Subject: Re: [PATCH] KVM: arm64: selftests: Add support for GICv2 on v3 Message-ID: References: <20220714154108.3531213-1-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220714154108.3531213-1-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, On Thu, Jul 14, 2022 at 04:41:08PM +0100, Marc Zyngier wrote: > 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). Thanks for the fix. This was my mistake (also I was taking too long to send the fix). > > Tweak the test to support multiple GIC incarnations. > Nit. You could add a fixes tag: Fixes: 3f4db37e203b ("KVM: arm64: selftests: Make vgic_init gic version agnostic") > 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 > Reviewed-by: Ricardo Koller