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=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 F00B5C4338F for ; Thu, 29 Jul 2021 17:48:30 +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 B863A6069E for ; Thu, 29 Jul 2021 17:48:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B863A6069E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=vDpBQNmQhg7Pvb16A0rIb2ZTe6yZoGVLR1fSrpkIUuo=; b=UQQhOdpHxfgX5G zwIoF/8kr8bD6xSu9+TXZ3jdb3sMUNt3H8BJyT+MibpiFMU47Xf7XdzvB4eT/Ro8AeEknQAaihWYA 2EFZDjO+9dD6QkebxBPCrcC0QMmCTvMT18Oe0FkFFQ9W9HNydpyxrXL/V0SoiKcgWQkbXBAuPBY7m f8JJ4+vQszvCtTU7YVqgDFBUPpssUVpU1bgGIGWUcI1LvcjcxA+UXbK1wbmJhRtz7zY83jeq77EnY a0107kiQ97jvJ31+eb5rjfkbCv6op5yOcbC9BxeQujyw1u04g8DZlW7ure5PNfWXVFTBF0PuBY/Vw b4ORRl719VzAMnEXXR3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9A6R-005P1C-Md; Thu, 29 Jul 2021 17:45:52 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m99yN-005Lyu-43 for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 17:37:32 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3053D60E9B; Thu, 29 Jul 2021 17:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627580250; bh=EKvkyVbCFIkHGIl1Aft6XfS6vxY/FRzv+NjTpqSFwTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YHMCVlwOOi6ic4rDNNGx9Oij9pzaBizxzHf56Ne3u7QSlJpSpfDx9spyLrqYUmrmE uGJR6UqYWh5uAPLLcW0thvDsdYOdEvmYXXKOomsUpCxvWb8qKgq5XxbXAcOpUu//4j 7In/Di1I54pXxppBW7bTzCMb/IqL8hUVuaO5L0cx9TX/3Xy1VeevGzF07bucJRTWda 3c4QlAiHxwb4VpT54tuKRvCngrYPrA2IPq0XbKrDnNpAhEWWP4GfGW5HP7esPveeSd H3+u1WmVonOTjNzVkdja407Y7DmU1g4ZVReSL2DIolJ64YNTTyKrGu3I0KVEdSnips qhoodCh67jCJA== From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Dave Martin , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, Mark Brown Subject: [PATCH v4 2/4] kselftest/arm64: Validate vector lengths are set in sve-probe-vls Date: Thu, 29 Jul 2021 18:37:11 +0100 Message-Id: <20210729173713.4534-3-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210729173713.4534-1-broonie@kernel.org> References: <20210729173713.4534-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1733; h=from:subject; bh=EKvkyVbCFIkHGIl1Aft6XfS6vxY/FRzv+NjTpqSFwTM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhAudGyb4Ch9ouisizN+OUT44lVwHjZYwPWcERArhr KSPtigSJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYQLnRgAKCRAk1otyXVSH0AjQB/ 9cy3Dhe8jQsatZLZOyh0podbS2Wvdb8brmBcdNtJuW/r4Jf+fSV2bZwrxK5JAt5U/f4HOGbrYOshRG nDaV5pY+pAW8vvsOzOGedeWF9YVTPnEbcvO7oUIO3Gd7EzBd6bgK2W595YV39V5wJ0fe7MFF9/a+B1 wS0ikGQl3Pa8CNTabL/O7KU9kijEShZ/9+pg0brFsklTEbcbJRxVDs1e3rorbxReZbHGe64AwgwomK t4Gm2nh71b7lxPuEQlGqpu/KdRKhYqIQcS3KnThHuTIxKLQ8ITkG7ku76rJcEhZlbFEZzUERfVLP4D s4VpWFHS5p5CtrTG1j9syExc+bbQCV X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_103731_216332_B071F3B5 X-CRM114-Status: GOOD ( 11.30 ) 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 Currently sve-probe-vls does not verify that the vector lengths reported by the prctl() interface are actually what is reported by the architecture, use the rdvl_sve() helper to validate this. Signed-off-by: Mark Brown Reviewed-by: Dave Martin --- tools/testing/selftests/arm64/fp/Makefile | 2 +- tools/testing/selftests/arm64/fp/sve-probe-vls.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/Makefile b/tools/testing/selftests/arm64/fp/Makefile index ed62e7003b96..fa3a0167db2d 100644 --- a/tools/testing/selftests/arm64/fp/Makefile +++ b/tools/testing/selftests/arm64/fp/Makefile @@ -13,7 +13,7 @@ fpsimd-test: fpsimd-test.o $(CC) -nostdlib $^ -o $@ rdvl-sve: rdvl-sve.o rdvl.o sve-ptrace: sve-ptrace.o sve-ptrace-asm.o -sve-probe-vls: sve-probe-vls.o +sve-probe-vls: sve-probe-vls.o rdvl.o sve-test: sve-test.o $(CC) -nostdlib $^ -o $@ vlset: vlset.o diff --git a/tools/testing/selftests/arm64/fp/sve-probe-vls.c b/tools/testing/selftests/arm64/fp/sve-probe-vls.c index 76e138525d55..a24eca7a4ecb 100644 --- a/tools/testing/selftests/arm64/fp/sve-probe-vls.c +++ b/tools/testing/selftests/arm64/fp/sve-probe-vls.c @@ -13,6 +13,7 @@ #include #include "../../kselftest.h" +#include "rdvl.h" int main(int argc, char **argv) { @@ -38,6 +39,10 @@ int main(int argc, char **argv) vl &= PR_SVE_VL_LEN_MASK; + if (rdvl_sve() != vl) + ksft_exit_fail_msg("PR_SVE_SET_VL reports %d, RDVL %d\n", + vl, rdvl_sve()); + if (!sve_vl_valid(vl)) ksft_exit_fail_msg("VL %d invalid\n", vl); vq = sve_vq_from_vl(vl); -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel