From patchwork Thu Jul 29 15:15:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 488733 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp2257247jas; Thu, 29 Jul 2021 08:17:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo6pvgh5xASyQ2CX09tOB3+7/apdwImE/xXPYXl7JDJrAOYGataSR8oJXblbQ0YyDXQusS X-Received: by 2002:a6b:f91a:: with SMTP id j26mr4613179iog.97.1627571872390; Thu, 29 Jul 2021 08:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627571872; cv=none; d=google.com; s=arc-20160816; b=x3JabCQKRxuqr9yjc+rKViMaFgFYKzDVTs4cRvsbEbXVEdTFXzkNMSeG8NvQDMIUHU amZLWswDfCuv7BA74qZSNRCBvrGoiIk1a5LIHd/PfMoqFZpR0Z2Y+0Bpxt2V3+f0AZtT 2gLCsxv1B+TGGZ7JrlYqS+lpU+Qg6WDOu2G6fgMj2AO7R/+Y3YWqhTHsqJxLbPrUtrep EPGSAMYEFNnODKTCdP5XkgO1e0TI5Oi/QFlPEE7lyk4dp5diRsUNAx0rig4NZ3iZx+6T 0jNBuCt0YSP0tBNfukeYE7OF2Gb6tj1mIa3TgWCAFYMdjgKrlUEEyIoprdJ6IiXqn2gK GDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7wVVt4os4wjwmrU1DlPSwI9dRzX7dbJ+CxbTwSVvCJw=; b=AVs34FSCTREWXOIuDYIWQMvmGgktZYChgW8gGYWxf3SZxh2e0OrjCiD6+IaVzm0iWF kP373fJagTbC/TOz4v+MuzHkqcVDhm/7w0ejevDGrDeJ4Fbofq6gDQe0LWjLt6R06Xn6 ffBJWvnmQiWNacTGhAuymBtXIYBUuWr4ikeFNrJXKF8DDxB2p5ekDlK9qOHOxqU+oZgh ac5jFLZJA/lvj3HX3m1xmYKWwRbxjYEAaau1f4Jioxl/kft0edkTSsJ8iMD2QKubDMvR trUSULBo5CHAkFToXGHzweAX9A+BgJpFmFyp9pswdWDVnnlAukRu7v5GzmTNIdzgpuCk tB7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cCctbs96; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si3979918iot.89.2021.07.29.08.17.52; Thu, 29 Jul 2021 08:17:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cCctbs96; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237783AbhG2PRv (ORCPT + 5 others); Thu, 29 Jul 2021 11:17:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:33858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237389AbhG2PRr (ORCPT ); Thu, 29 Jul 2021 11:17:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF32460F22; Thu, 29 Jul 2021 15:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627571864; bh=EKvkyVbCFIkHGIl1Aft6XfS6vxY/FRzv+NjTpqSFwTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cCctbs96Yy3opqXLoqxaLWinWS14nosGJfsPvGsDPw9yxiRC66GFrO//0XbuT7Lkq 9Gi0ozl83BjSGlLaPZ/BaVSPHoZElsmdHqPH8a+1m0vdjvSfsNByoE3WyNmjzhzGww e38nOXhrbB7pvVOmrm2vP1n8dOBb+E+/Jo52I5hkZVBKl83WvOo4uEwxhYunY7c74g xFq9aX4wEoZwGzw1EQR1Iyh+iwoxWregCBmSWnrwP/CZFEVHfP3Ud6SfuWacG6eKP8 bt/NHamzjMp6XLFbdN0hkTNL/oNpquYeaIpbQ3nit2V2ewFSS/EGj662U9nH04nJbB fG+z+KFWawrlA== 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 v3 2/4] kselftest/arm64: Validate vector lengths are set in sve-probe-vls Date: Thu, 29 Jul 2021 16:15:16 +0100 Message-Id: <20210729151518.46388-3-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210729151518.46388-1-broonie@kernel.org> References: <20210729151518.46388-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/pANAwAKASTWi3JdVIfQAcsmYgBhAsX9yb4Ch9ouisizN+OUT44lVwHjZYwPWcERArhr KSPtigSJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYQLF/QAKCRAk1otyXVSH0G0DB/ 4x4vg9icKgSbpN6iOEfUzPYMVINGCvd7LhD/Z2HfDD8kgdRVSnfNxb9AprS19XSshdoC0yh+2tRkQ8 IqAI/axGNhky0CA/tO3fZBz8YE2UPSu/EC94BbgLaRbg7didiVstlLIGZiN97sVItY6SW4ZVGrxXym T0GOuTXNasckkq860LFuMiKGd6YMN82Dma1pxmUfwlxv2X4v/l6F1P87HyeYQdLVMyUG9YPs3mgPHL 2QvTH4MXtryhLK7NM4Bu/RUtuLitBRzpk8fyNMXtdk3+wSVbnOkGqo9zyTmn26StYGgvqf87Kutesw RDOhPPAnEpOEr4mH72Uu2S9pll8m7K X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.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(-) -- 2.20.1 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);