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 391D9C28CF5 for ; Wed, 26 Jan 2022 14:52: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: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=uGAn63fhntXEMeCbc99GuBhT40rdf7civsj98iqkvrQ=; b=iRjYVYfRHDDgxd 1R8upmahxBn+HmCfrSNy30jjvD1kuL4IVlP3j7APpXjKqWR41BPv/bvZBlLhWXRmRD/fulU5n9S79 qoQ134fBAmJygaIBxCnTe2WH12aD4Qqk1a3i/y6czXwOdIezJJTqDkuExdWamOWdA9jBzzgKqhHGe ixW/CMc4TtQtAvUTaEmgARB03oQxnWd0dZ/MX/GH/olwuzIDMckmB1y5Una13iwsVF0cP/X9lThAG catRqB6txtYCosvaRcSXac1s8oxAfkcjqMXJx56ZGXDMPdtt0GT5hzSyYpYaY+F+PsznUuSRfKwjh rTfEPIqzIftUUutzydYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCjdE-00C20W-1h; Wed, 26 Jan 2022 14:50:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCjdA-00C207-Ds for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 14:50:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643208638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=24kMRqjE/mfts4KLJ2o54Nm09IK0MxEZxPEl8a0jE8A=; b=T9ngbtj+gXNjZe3/raBFhA/tQxQ31y2lNQI7IWEPg7nTQoxa58KSNir+TCNvfNWW/vZy3C PI5p5HvIdA4n5T+Rls2a1lzsmrL303whPRer2g2c0uXhoTnzgw89auXaV0NxnhA7+XQNx1 2rMREBHMhyjeazW2HFSKdWFCwB+3sW4= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-110-jTJ-jjvmO4eQWQpKkHscNw-1; Wed, 26 Jan 2022 09:50:37 -0500 X-MC-Unique: jTJ-jjvmO4eQWQpKkHscNw-1 Received: by mail-ej1-f72.google.com with SMTP id ky6-20020a170907778600b0068e4bd99fd1so4980338ejc.15 for ; Wed, 26 Jan 2022 06:50:36 -0800 (PST) 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=24kMRqjE/mfts4KLJ2o54Nm09IK0MxEZxPEl8a0jE8A=; b=BW16jwSz52/d+73z6nLWJeUhHvvTBvu0bf0pHAm1pFyR8oJ5Y4Rc7ayr1xzZT84z5+ 6tRPfsrcWwYVXyII9WcoolKnkunaACeXGiIVYL/qTTkPXWw0J4BrU1RR8zfrhd8k5iHz u23kL7j4L4rdbC2b3tDdPDQObneERV4ik7P15gr8N1gpXCJZVRc+OHyaLsjxMXJ7D9aP v7HTyhb55RwlhvIlJV31Ukh0M54k+xvWN43IfHUfIgMMOSWapgJIbpXTwnt7XvQpNPWJ ay1njghcjiCkthSRIxHRmC0jXm9slzj6UqUOySyAv/QwscjXUcnAlnWTL8bEj/B0wB1Y ZU4Q== X-Gm-Message-State: AOAM530/epQqsllIpmsZOZOk88+DGdnyedYdXnp4jF4SnfKvMlyIGrG3 0HSMwbbJ9JH9bbvJXFZz43IUfu1CVO4xp88HvK58gAIiVJiWv1oktumYMHUuCUEbZwDVIgrm/Y7 S7YGLL2OqnooT92ZFvOa3qb6lF8J/ZexctNM= X-Received: by 2002:a05:6402:190f:: with SMTP id e15mr13639037edz.203.1643208635945; Wed, 26 Jan 2022 06:50:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBd/vEwW4Z/avy9Ldd+WhZ42kptNp4wXi1sz3pTq9kDD70yxHrMmoYahynWpglFwM0w/OaQA== X-Received: by 2002:a05:6402:190f:: with SMTP id e15mr13639020edz.203.1643208635749; Wed, 26 Jan 2022 06:50:35 -0800 (PST) Received: from gator (cst2-173-70.cust.vodafone.cz. [31.30.173.70]) by smtp.gmail.com with ESMTPSA id k24sm5955935ejv.179.2022.01.26.06.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 06:50:35 -0800 (PST) Date: Wed, 26 Jan 2022 15:50:33 +0100 From: Andrew Jones To: Mark Brown Cc: Marc Zyngier , Shuah Khan , linux-kselftest@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] kselftest: kvm/arm64: Skip tests if we can't create a vgic-v3 Message-ID: <20220126145033.nwsf2g7dim7yeoz2@gator> References: <20220126135319.1918802-1-broonie@kernel.org> <20220126141741.zxxltis5zdtjzz33@gator> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_065040_570343_C1AA511E X-CRM114-Status: GOOD ( 24.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 On Wed, Jan 26, 2022 at 02:29:14PM +0000, Mark Brown wrote: > On Wed, Jan 26, 2022 at 03:17:41PM +0100, Andrew Jones wrote: > > On Wed, Jan 26, 2022 at 01:53:19PM +0000, Mark Brown wrote: > > > > - vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA); > > > + ret = vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA); > > > + if (ret < 0) { > > > + pr_info("Failed to create vgic-v3, skipping\n"); > > > Please use 'print_skip', which appends ", skipping test" to keep the skip > > messages consistent. Also, print_skip can't be disabled with -DQUIET like > > pr_info. > > I see. It might be nice to convert these tests to use the ksft_ > stuff... Indeed. I'll add that to my TODO. > > > > - /* Distributor setup */ > > > + /* Distributor setup - test if it's possible then actually do it */ > > > + gic_fd = kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, true); > > > + if (gic_fd != 0) > > > + return -1; > > > gic_fd = kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, false); > > > kvm selftests generally asserts on failure with the nonunderscore > > prefixed KVM ioctl wrapper functions, which is why you appear to > > be forced to do this nasty dance. However, kvm selftests usually > > always also offers an underscore prefixed version of the KVM ioctl > > wrapper function too for cases like these. So we can just do > > > if (_kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, false, &gic_fd) != 0) > > return -1; > > And the _ version is OK to use in the vgic code? The _ makes it look > like it's internal only. It's extra OK. Anything in lib/* or lib/*/* is internal to the lib. However, it's even OK for a unit test to use the _ prefixed functions. The _ isn't so much about being internal as it is about being a raw version of the ioctl wrapper, which returns error codes, vs. the asserting version of the wrapper which only returns results on success. Thanks, drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel