From patchwork Fri Dec 10 18:41:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 12670691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20E05C433FE for ; Fri, 10 Dec 2021 18:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234149AbhLJSsk (ORCPT ); Fri, 10 Dec 2021 13:48:40 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:47862 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235951AbhLJSsk (ORCPT ); Fri, 10 Dec 2021 13:48:40 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 9B1E0CE2C78 for ; Fri, 10 Dec 2021 18:45:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51835C341C5; Fri, 10 Dec 2021 18:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639161901; bh=P2l5Y5PDPDJcPc6k74icHUD6sRurj6ctKkCgiE7n3uE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ii382Rjt8WRQIaBef9uaxzbqJ0vwyKHLClY2xfH/YG3r/5YLmnPMzLSBu/h/t0Eh3 2azjXJfdmiJgjl+jTDhcl84VPVrYutM8K847KVs0wipT8IRpJYed7PSjf9CSVEKjfo emhELtme2lwd+KdXk5pF+EvEBeHmCX/X8d2Jr5uWLD0ibhdj3rRQX9fBo7ut3nDUPb HJJbP/5kGBV2FbPg6fEvegsDc0fC2XKcUA3DF2on+EDunj6omROq6TkGVDviVbBZKs ipoBTrQKSwOP7nm5wAJiIIifiI7iTQmcuJ++PF+BryrBkct2Fdg5//LlBd4DZkcTFl nKtKVDKgdntMw== From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan , Shuah Khan Cc: Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, Mark Brown Subject: [PATCH v7 29/37] kselftest/arm64: sme: Add streaming SME support to vlset Date: Fri, 10 Dec 2021 18:41:25 +0000 Message-Id: <20211210184133.320748-30-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211210184133.320748-1-broonie@kernel.org> References: <20211210184133.320748-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1924; h=from:subject; bh=P2l5Y5PDPDJcPc6k74icHUD6sRurj6ctKkCgiE7n3uE=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhs59VOiCWCuqdEhEwDeB0fuhFIzO/DqyGIULZWFjy SmyMmrCJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYbOfVQAKCRAk1otyXVSH0OoaB/ 9/QOiyVUDDjZI6M8ZJGBnr5yO+RHbbEl8usFf3QyOZ25f9n74GH6vuoQp3r29XXIqTG7K2l3lXVQKu 6ZtxebI0GQSO92cYTA7MdoAmjnUZlBsoQyjer0qMgXI5u21qbZFy6GOeqWY/tlAUxop5Ygh28GwoBz OSgJw6tP7eAxp6Q0CVMX11h2lkasz1um+i09bKKwy9W5l8OgVhUjY51mPrXwzJJcKJ5rENND/YuLWb 5dHqsENuHt1ih46NQzkXPvS69NgX1TwIS6l6TTY7z0RkWg1Rf0pYwjwW6CxY083G5yjkOTeDNxjqMq IHyDs4w/usB3xF7uXPER1rt7Vh+QTd X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The Scalable Matrix Extenions (SME) introduces additional register state with configurable vector lengths, similar to SVE but configured separately. Extend vlset to support configuring this state with a --sme or -s command line option. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/vlset.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/fp/vlset.c b/tools/testing/selftests/arm64/fp/vlset.c index 308d27a68226..76912a581a95 100644 --- a/tools/testing/selftests/arm64/fp/vlset.c +++ b/tools/testing/selftests/arm64/fp/vlset.c @@ -22,12 +22,15 @@ static int inherit = 0; static int no_inherit = 0; static int force = 0; static unsigned long vl; +static int set_ctl = PR_SVE_SET_VL; +static int get_ctl = PR_SVE_GET_VL; static const struct option options[] = { { "force", no_argument, NULL, 'f' }, { "inherit", no_argument, NULL, 'i' }, { "max", no_argument, NULL, 'M' }, { "no-inherit", no_argument, &no_inherit, 1 }, + { "sme", no_argument, NULL, 's' }, { "help", no_argument, NULL, '?' }, {} }; @@ -50,6 +53,9 @@ static int parse_options(int argc, char **argv) case 'M': vl = SVE_VL_MAX; break; case 'f': force = 1; break; case 'i': inherit = 1; break; + case 's': set_ctl = PR_SME_SET_VL; + get_ctl = PR_SME_GET_VL; + break; case 0: break; default: goto error; } @@ -125,14 +131,14 @@ int main(int argc, char **argv) if (inherit) flags |= PR_SVE_VL_INHERIT; - t = prctl(PR_SVE_SET_VL, vl | flags); + t = prctl(set_ctl, vl | flags); if (t < 0) { fprintf(stderr, "%s: PR_SVE_SET_VL: %s\n", program_name, strerror(errno)); goto error; } - t = prctl(PR_SVE_GET_VL); + t = prctl(get_ctl); if (t == -1) { fprintf(stderr, "%s: PR_SVE_GET_VL: %s\n", program_name, strerror(errno));