From patchwork Tue Jul 27 18:06:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 486744 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp458566jas; Tue, 27 Jul 2021 11:12:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnqYicQI18s0VNAD6GbAGxKrtUOR41YoECay7+cNdVzLBCBHii24d4pz7e7BUco+o6UGDG X-Received: by 2002:a02:cc41:: with SMTP id i1mr274912jaq.42.1627409551302; Tue, 27 Jul 2021 11:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627409551; cv=none; d=google.com; s=arc-20160816; b=b8kqPZZEnXfgqGUXiXf/leICHS1ZLNORQkW7lHHrdx9x2z7FdmnrIU2Qq2PHNzd5fO m/MFryn2KYgKuduHqVokR/ErP+L/EWPueQpN7vjmcS6ABZLGHl28bT/JaY0eWWaHRoGO 5sArxl7bd0ZhWva27pSdCjUBv4eVqsV7MGls5Aq1umdmYukvuAPmw7oOxeZ1g7Vmhc/N 5Kn3PcwCDogc1Mz3fQ9zjXfCTZ5uFEW4d4wBuND8aCslU669PThz9DoYa6yQ7GmQuSe9 08MfltKxss9a4M9IZ5Ho/nLU1ATCVLalxZhX4APYX7gD7JEE6XKALy07MEHHxg8oLy84 Da2A== 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=THcrfdMvfhpDQv1scEEE8SuGz90JdKwDKrN8YZEsb8g=; b=OOh6H531me5y6t9CZBb412706B/hhsY+8HP2WOH567paL5F9FijRKKWWfQoXUrQx8q fwAIuas/PWTx+wZih10sZ72N3gYQVytmK0Ahoi6RSFMJEA59B18ensxOqBaZJlxIrkPy Z+l/qnot8X1p8YQDk8w07gse8EMQ3i8ioloMOVZ1Njy2I7iF1prCuSO+BjtAiq1kY1t5 M3AddrQzjpFaYKYDsPuUXnvIVhZMUMLHFu7uYZ2Cjd7xJa7os/aNdwDv5P59j9NHu5+I RR/uRVXqKC5cqLeBz6eJ31awVjGehT8e6utEVwZsZH9EnQtYI9XXyW0eGlY6TSscrJOZ b9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ohDamLSv; 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 n14si4577533ilk.78.2021.07.27.11.12.31; Tue, 27 Jul 2021 11:12:31 -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=ohDamLSv; 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 S230139AbhG0SMa (ORCPT + 5 others); Tue, 27 Jul 2021 14:12:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:55130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbhG0SM3 (ORCPT ); Tue, 27 Jul 2021 14:12:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 71D9B6056B; Tue, 27 Jul 2021 18:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627409549; bh=Yogziv8PBor2Z+LTr480PcDONcJAPIutmJu/cs7cZNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ohDamLSvQj4DYIQYad/tLVBerRQWMe69569RKqwxKQbkVh6ByFqHom9jhbOY2jGD5 LD3bJpG6EEK2ZE9nrBqOfd4K9nGeij8sqZ6UIM/19ErJLiWCYUWlBVhdiJRnNg6slC 67QU4PUpz9KE2YgVpNHNyKU38VEgpJ4C8On6jFbixWayv2n+fR7kvbnMrcMVfBN1C9 cJahCyCuJI9qrCJFZhftfeOYnLOvUNFCzUlYAl1X0M0mCICrP2oJNi4wFOwoiAzV/Z VwUbdxdOfY3XPWbaLwaa0whgXpzl0SxsInNAYR0AYFBF1R31RclxvgoMreYGNoj9HQ cXxgHzDotIEqw== 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 v1 2/3] kselftest/arm64: Validate vector lengths are set in sve-probe-vls Date: Tue, 27 Jul 2021 19:06:48 +0100 Message-Id: <20210727180649.12943-3-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210727180649.12943-1-broonie@kernel.org> References: <20210727180649.12943-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1670; h=from:subject; bh=Yogziv8PBor2Z+LTr480PcDONcJAPIutmJu/cs7cZNo=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhAEs3KQJ/yaogg10mK29zjdVxMAETaLlSzXfmk+GF siJf8J6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYQBLNwAKCRAk1otyXVSH0MULB/ 0ZSdCFGTQsIEQZPmYE3sLhSdwynr3ZUYEinmcduIVnXelz+95fe4ntXlScZ8nZRbPdoZuNs2s1rS8t oG9+snltXTGkqDjPEEgvk4xn4vFYJzhbyGJ5OW5YUYioKEmYqSYULGJ2ScbU/MwbNlWGF3GX2x2BZp vRgY9oZ+gZE9/+mJVkUk3yFVmq6U24WTzK5KTMyINQztqx+ugHNB+OMD458WB+xN34+/jliTK3/pGY 4S7zarAyO+7LSWSnaaWOp6sY/fpIy0C5yuRYRpUp5iaV+Xkam6lVvTvSpHqEQexufatIqdYGGQT+W/ +n3PMqYe9sGcFCA8DyzkfLGvcHuHPu 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 --- 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..a6cd1bd6e515 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("Set VL %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);