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 X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49767C4338F for ; Wed, 28 Jul 2021 11:39:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2E3C260E9B for ; Wed, 28 Jul 2021 11:39:12 +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=06JkXNxaEIOqwH1zmXFXOHQU1Wh1FX6CT61EZxMx7PE=; b=qYN5/bvuc20aLS gxyL1MV9XZgyEc20z27CmSjlAhiucomdoLjWNcVE9FPmH8Zi7eQa/RC4QIjB8jh2FOID/MqBMmFP7 EZ9iu/pFYeHcalRw4p/5jk9/U95TL3S81UlMUqXbh5LkQHeyRYx2nWwe8yn5+L27apfkqAeflXByF VZDYYiriUpdN7ROc6bOjIDoy9sMnSRq2ANeSFHqFC6MQJo8lr+gQmSpaO/8gbWoEwa09y+oUYkboo 8jTK5ivBsfIiX0dgGZklrqudyqPLbUBve0AK75jEBZi7mtgqVhdmNbyRp8aCS5f9J4V/NRc5PFgls U4KrU0QZIj8PLUfGTCGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8hs5-000YA6-VU; Wed, 28 Jul 2021 11:37:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8hs3-000Y9k-6C for linux-arm-kernel@lists.infradead.org; Wed, 28 Jul 2021 11:37:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A600131B; Wed, 28 Jul 2021 04:37:03 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BE36F3F66F; Wed, 28 Jul 2021 04:37:02 -0700 (PDT) Date: Wed, 28 Jul 2021 12:35:42 +0100 From: Dave Martin To: Mark Brown Cc: Catalin Marinas , Will Deacon , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v1 2/3] kselftest/arm64: Validate vector lengths are set in sve-probe-vls Message-ID: <20210728113542.GE1724@arm.com> References: <20210727180649.12943-1-broonie@kernel.org> <20210727180649.12943-3-broonie@kernel.org> <20210728094151.GB1724@arm.com> <20210728110701.GC4670@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210728110701.GC4670@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210728_043707_324089_C6AA5726 X-CRM114-Status: GOOD ( 36.07 ) 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, Jul 28, 2021 at 12:07:01PM +0100, Mark Brown wrote: > On Wed, Jul 28, 2021 at 10:41:51AM +0100, Dave Martin wrote: > > > This test was originally a diagnostic tool, so the way VLs are probed > > aims to be efficient, rather than being defensive against the kernel > > doing weird stuff. > > Yeah, the whole probing thing doesn't really fit into kselftest's idea > of what a test is - I just put this in here since it seemed like a cheap > extra validation that we could add in with little bother rather than > because it's a complete and thorough validation of every possible thing > that could go wrong. I'd be just as happy to not modify this at all but > since it does try the intermediate VLs it didn't seem like a terrible > idea to throw in some validation while we're at it. > > > If the kernel returns a vl > than the one we tried to set, we'll end > > up in an infinite loop because of the way the loop deliberately uses the > > kernel's return value to skip unsupported VLs. So, it might be better > > to probe every single architecturally possible VL and sanity check > > everything instead. > > Yup, that'd obviously be a complete rewrite though. We'd not only need > to probe every possible vector length, but also validate that any > unsupported vector lengths report the expected vector length instead > when we try them. Fair enough, but is it worth dropping a comment in to clarify what this does and doesn't test? This could be an area for future improvement. > > > + if (rdvl_sve() != vl) > > > + ksft_exit_fail_msg("Set VL %d, RDVL %d\n", > > > + vl, rdvl_sve()); > > > If this fails, the VL vl wasn't "Set" at all. I found this a bit > > confusing from just looking at this hunk. > > > Can we write something like "PR_SVE_SET_VL reports VL %d, RDVL %d"? > > Sure. > > > I'm not sure of the correct option for forcing SVE off against the > > compiler default -- check with the tools folks. If there isn't a > > proper way to do this, it's a toolchain defect so we should flag it up, > > but -mgeneral-regs-only might work for us even though it's a bit of a > > sledgehammer. > > -march should do the trick (if it doesn't the base kernel already has > issues). This is a separate issue that affects all the arm64 selftests > I think. OK, if there's already precedent then I guess we can go with that. Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel