Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9944412rwp; Thu, 20 Jul 2023 12:05:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5+EgqA1wgFRk1bLXf8Ntm0elVMRb1Qs1vOfdUXQXjkucKsexQlAv2nUnfslbcUfQi8feq X-Received: by 2002:a17:902:e74f:b0:1b8:b478:a103 with SMTP id p15-20020a170902e74f00b001b8b478a103mr168171plf.10.1689879911578; Thu, 20 Jul 2023 12:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689879911; cv=none; d=google.com; s=arc-20160816; b=PV/5fsW1S9fdtqVRSUCa35hf6eGwyI1f3Fj9xaBobnb7b7sIMWwqfl1odiXulFdAE0 Edc1NdxCLQyt84T31XxIC7mnkWBc5m8ZG21vby4mHlKYvhbRSO8I4G2zDOPbW0VJciwJ H6ufyIqMyu0NlZW2Jh+r+k+iPbHI86gTu9vKO32nAoiBtLoABZYPySqF3L4fzM2BXtBL X8j5OybCCpq3I2WVrgkrj4TjscH2Hrhuco0HV6+pqlTTFF0gVlg3l0Y0ypZOzV92aZJR v+ItDqrOdjROFZ0amMnDV+LHEwKJpy2YJE2IxC3L/4f+K5fGDtpzeQXAlteiafqz51LK wHIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=HMfGh4jxuK4mpZ1jh7ge2LLCAIqiPoyGR8SpCb+t8x0=; fh=uJMLtksqvJZrsv4Tz47lujlNMgmmE8Yxkkg7Yj3ceBg=; b=ejeNV7r4I4mCNd7iOvb4aQJvE88Ap7OPu4sB7TK1w+bdS2Ic4ZOqWPve9WkiAaeA3x 6R30SeGkRwUADF6CxXX6ei8fZZVMWc4AoTivN+KMLsaJ+4apuOj2uIyl1wu9aZwy8kfM V3C/t9eDtN35AnOmPdQC/KzBt7R8AlOoNhgo1BCOkK+pwRoA1WHkeUe0CuKlD+7vouRh pIVo552sI9z4S8M++kHdbXJtd5Awix/fbxDlRbl8do0OihPG2CHqPtrgJUIYbrFcyUuJ GaicEdDzZJgDOoqXNxNwNWgX7G6FZG8NdzOsyC8c+LufHITzfcEjHUPDry74BnkzL/Ri xZ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mtgFWNoV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i12-20020a17090332cc00b001b811261289si1499521plr.482.2023.07.20.12.04.58; Thu, 20 Jul 2023 12:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mtgFWNoV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232144AbjGTSj2 (ORCPT + 99 others); Thu, 20 Jul 2023 14:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232141AbjGTSjY (ORCPT ); Thu, 20 Jul 2023 14:39:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C90270C; Thu, 20 Jul 2023 11:39:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B7EC761BFD; Thu, 20 Jul 2023 18:39:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D507EC433C7; Thu, 20 Jul 2023 18:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689878357; bh=rXmOaMmqlk7QrELiC/kSDYYNiucDsBT8D5q7ohFdQ7s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mtgFWNoVWqppKfmmwXxHY8o8mfruxBcpLKPaSxviOeFSB2G6+jMlgOJ78/GJK3zyM YQivuehx4s4SjWWsN4xM6sAZEmyXkgNLlOCVKMv5/xVfMtIakGE6/QZZ2mrU4UynjF tKKo//JJKRRtRb7kfd4cL551+M2efF1R39kVXMKFbpLfzwSMUw/OP4XcFSU9W8/nNo vAOm8V2nd41dZcex48k+lsUx8u9tcNB+lr5v0KU8du4AY9lF1lJ4lK+1YMQIian7P4 6MW26EsuCRI0e8fp0Wt5lWv/DJp16stqfeaB6fGqRnqZHFrOpparJUO+S4O++RMeRR mQmFpyuK9SXcQ== From: Mark Brown Date: Thu, 20 Jul 2023 19:39:00 +0100 Subject: [PATCH v2 3/3] kselftest/arm64: Validate that changing one VL type does not affect another MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230720-arm64-fix-sve-sme-vl-change-v2-3-8eea06b82d57@kernel.org> References: <20230720-arm64-fix-sve-sme-vl-change-v2-0-8eea06b82d57@kernel.org> In-Reply-To: <20230720-arm64-fix-sve-sme-vl-change-v2-0-8eea06b82d57@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan Cc: David Spickett , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-099c9 X-Developer-Signature: v=1; a=openpgp-sha256; l=1868; i=broonie@kernel.org; h=from:subject:message-id; bh=rXmOaMmqlk7QrELiC/kSDYYNiucDsBT8D5q7ohFdQ7s=; b=owGbwMvMwMWocq27KDak/QLjabUkhpSd9R4iIrrWIkXKwQIKwffTPk6wM8nqKk9d36291sEiQZGh RbuT0ZiFgZGLQVZMkWXts4xV6eESW+c/mv8KZhArE8gUBi5OAZjItzvs/wu9qy0kFdUf+G5IsXo2/7 hA/Zn8hGUznl1ZPTH9wTmOLVdtiw/kbM9N97+d5+DiXm8a6/TobS7388Be7ldpHnN0dyVNim351vDA WqKm+F/G2X3MsWyJxz9HX5zkW7pn0i03lxcy880MNniqfGGxDs7qibDhvLnvuv5tJVnG6sSsN05Tvq fJcabuT4uY0G9hfKT9xgSn74s2X/tdqdapw/J7eYjvi3vGwuY62bc1ZQVvepYWpLX32+zYvbr9KacP u8gNfevc8sqUee8MqoKOGG6Yaxr3xlZnayjTMyMdnqYVRdZH+jQbNXtN+BS4xPXm75nPVmG++OfPu4 KnZWZU9m3ZG8tzRNjlQ8wdDi4A X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On a system with both SVE and SME when we change one of the VLs this should not result in a change in the other VL. Add a check that this is in fact the case to vec-syscfg. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/vec-syscfg.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c index 58ea4bde5be7..5f648b97a06f 100644 --- a/tools/testing/selftests/arm64/fp/vec-syscfg.c +++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c @@ -554,7 +554,8 @@ static void prctl_set_onexec(struct vec_data *data) /* For each VQ verify that setting via prctl() does the right thing */ static void prctl_set_all_vqs(struct vec_data *data) { - int ret, vq, vl, new_vl; + int ret, vq, vl, new_vl, i; + int orig_vls[ARRAY_SIZE(vec_data)]; int errors = 0; if (!data->min_vl || !data->max_vl) { @@ -563,6 +564,9 @@ static void prctl_set_all_vqs(struct vec_data *data) return; } + for (i = 0; i < ARRAY_SIZE(vec_data); i++) + orig_vls[i] = vec_data[i].rdvl(); + for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) { vl = sve_vl_from_vq(vq); @@ -585,6 +589,22 @@ static void prctl_set_all_vqs(struct vec_data *data) errors++; } + /* Did any other VLs change? */ + for (i = 0; i < ARRAY_SIZE(vec_data); i++) { + if (&vec_data[i] == data) + continue; + + if (!(getauxval(vec_data[i].hwcap_type) & vec_data[i].hwcap)) + continue; + + if (vec_data[i].rdvl() != orig_vls[i]) { + ksft_print_msg("%s VL changed from %d to %d\n", + vec_data[i].name, orig_vls[i], + vec_data[i].rdvl()); + errors++; + } + } + /* Was that the VL we asked for? */ if (new_vl == vl) continue; -- 2.30.2