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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 730CFC433F5 for ; Tue, 8 Feb 2022 00:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Agfk/UJX7yQ9EID233vgApouSJq+qO5soasxTBK4tME=; b=p4xRKGjd+oo2lkaL5A0isPsLcC IlCSuXTtIp6+e3qLm16Tkf+LFtiLa6cd8IgwwwZvhRpHmlMW27HPsm5GN2rrDR6ljopE3lK1fhWzz G7O6WWprc7HhAiG2etw5ky808IWC2mkMm1A1agYxuDWfS6R0gWApjeYkzLu42hQjXYkIIeoOHeKK8 C4oWiicgWxsDbGshtlOd8yAzO1kdTHAILivg/ENzDoENxEWxr98041bgwZy6KRAh/ufhnO+DvoT5h +J7xMZg/9oDDdSrJR8rxra6/2CPaj2DlFBE7WUwPxIo9GvEU0BOagbESR9DXx+l1502XJ9kAHeWkj mMcYxR+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHEJ7-00C3Ai-Bm; Tue, 08 Feb 2022 00:24:33 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHEJ3-00C3A5-KC for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 00:24:31 +0000 Received: by mail-il1-x131.google.com with SMTP id f13so368915ilq.5 for ; Mon, 07 Feb 2022 16:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Vgz3vJoxRCjSxOnu8bDTDSG6VAB8AKydsEfZW+RiuBU=; b=B5KTjIHd8JJqHtNAMC1PzjEXLhYAW2XGJzTUChMhTd6LR06BDZAjdj3VR8ZJl39Lhr UwjfvA8N+T9GscLNPUjTnG9su+HIUOkeeROhdU9c70mhjFhpbXH038YJob6suCbeGYtT C2cZOtAaQX3X8zHX7grA+riPzBbXH6x3G8Z+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Vgz3vJoxRCjSxOnu8bDTDSG6VAB8AKydsEfZW+RiuBU=; b=5LLUoOX1G6E31kuKWNbdW7eqVBNic2awhXe9qzCnTwAa1nWkTmgbwuwkJrczYrQxg4 gHVzK8jvDTCnwuhb0p9UTSUiyUyTcOsJ+tePi8AoLoKEAuG04iVF1yJRAgX2WvMZXfrB Kb84tTWR7q+f7FVt3xhNkMyJ6H+v49/rTglZZ6MDgxLW+RnO7G4Lxr+bclrQUB+qeuHr tnLzDJurYyD3HxJsBDmPuAnFQ/+DZwm8kIcmS60GxHo4jWzDG/IBsdChPcrLRMDQBsiX QT9MacJsBbHJVMTZDHN/TTWOcxbF6PXY6ycT0wAjlkpG6K1WFDs32r+A4sv4VbJPU8so osfA== X-Gm-Message-State: AOAM532D62kKomKQKXbYm0dB5oou2pR4RSJifvxnlwKhGXLdjhJEtZu+ N26UdZgx5r6uw82uhuMzzrnqgw== X-Google-Smtp-Source: ABdhPJxhj/ObwJzAC/vSnKWt7hzqF0me2g8ZGst3fT1kLBYK5mtfxm3nxbacAfWRZVou8UtBvqjbNg== X-Received: by 2002:a92:5208:: with SMTP id g8mr963001ilb.310.1644279868967; Mon, 07 Feb 2022 16:24:28 -0800 (PST) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id t2sm2986140ilp.49.2022.02.07.16.24.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Feb 2022 16:24:28 -0800 (PST) Subject: Re: [PATCH v11 33/40] kselftest/arm64: Extend vector configuration API tests to cover SME To: Mark Brown , Catalin Marinas , Will Deacon , Marc Zyngier , Shuah Khan Cc: Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Shuah Khan References: <20220207152109.197566-1-broonie@kernel.org> <20220207152109.197566-34-broonie@kernel.org> From: Shuah Khan Message-ID: <32b86e20-8a4e-42ac-f5d9-188f1d80e412@linuxfoundation.org> Date: Mon, 7 Feb 2022 17:24:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220207152109.197566-34-broonie@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220207_162429_702257_0BCCE398 X-CRM114-Status: GOOD ( 22.33 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/7/22 8:21 AM, Mark Brown wrote: > Provide RDVL helpers for SME and extend the main vector configuration tests > to cover SME. > > Signed-off-by: Mark Brown > --- > tools/testing/selftests/arm64/fp/.gitignore | 1 + > tools/testing/selftests/arm64/fp/Makefile | 3 ++- > tools/testing/selftests/arm64/fp/rdvl-sme.c | 14 ++++++++++++++ > tools/testing/selftests/arm64/fp/rdvl.S | 10 ++++++++++ > tools/testing/selftests/arm64/fp/rdvl.h | 1 + > tools/testing/selftests/arm64/fp/vec-syscfg.c | 10 ++++++++++ > 6 files changed, 38 insertions(+), 1 deletion(-) > create mode 100644 tools/testing/selftests/arm64/fp/rdvl-sme.c > > diff --git a/tools/testing/selftests/arm64/fp/.gitignore b/tools/testing/selftests/arm64/fp/.gitignore > index c50d86331ed2..6e9a610c5e5d 100644 > --- a/tools/testing/selftests/arm64/fp/.gitignore > +++ b/tools/testing/selftests/arm64/fp/.gitignore > @@ -1,5 +1,6 @@ > fp-pidbench > fpsimd-test > +rdvl-sme > rdvl-sve > sve-probe-vls > sve-ptrace > diff --git a/tools/testing/selftests/arm64/fp/Makefile b/tools/testing/selftests/arm64/fp/Makefile > index 95f0b877a060..a224fff8082b 100644 > --- a/tools/testing/selftests/arm64/fp/Makefile > +++ b/tools/testing/selftests/arm64/fp/Makefile > @@ -3,7 +3,7 @@ > CFLAGS += -I../../../../../usr/include/ > TEST_GEN_PROGS := sve-ptrace sve-probe-vls vec-syscfg > TEST_PROGS_EXTENDED := fp-pidbench fpsimd-test fpsimd-stress \ > - rdvl-sve \ > + rdvl-sme rdvl-sve \ > sve-test sve-stress \ > vlset > > @@ -13,6 +13,7 @@ fp-pidbench: fp-pidbench.S asm-utils.o > $(CC) -nostdlib $^ -o $@ > fpsimd-test: fpsimd-test.o asm-utils.o > $(CC) -nostdlib $^ -o $@ > +rdvl-sme: rdvl-sme.o rdvl.o > rdvl-sve: rdvl-sve.o rdvl.o > sve-ptrace: sve-ptrace.o > sve-probe-vls: sve-probe-vls.o rdvl.o > diff --git a/tools/testing/selftests/arm64/fp/rdvl-sme.c b/tools/testing/selftests/arm64/fp/rdvl-sme.c > new file mode 100644 > index 000000000000..49b0b2e08bac > --- /dev/null > +++ b/tools/testing/selftests/arm64/fp/rdvl-sme.c > @@ -0,0 +1,14 @@ > +// SPDX-License-Identifier: GPL-2.0-only > + > +#include > + > +#include "rdvl.h" > + > +int main(void) > +{ > + int vl = rdvl_sme(); > + > + printf("%d\n", vl); > + > + return 0; > +} > diff --git a/tools/testing/selftests/arm64/fp/rdvl.S b/tools/testing/selftests/arm64/fp/rdvl.S > index c916c1c9defd..20dc29996dc6 100644 > --- a/tools/testing/selftests/arm64/fp/rdvl.S > +++ b/tools/testing/selftests/arm64/fp/rdvl.S > @@ -1,6 +1,8 @@ > // SPDX-License-Identifier: GPL-2.0-only > // Copyright (C) 2021 ARM Limited. > > +#include "sme-inst.h" > + > .arch_extension sve > > .globl rdvl_sve > @@ -8,3 +10,11 @@ rdvl_sve: > hint 34 // BTI C > rdvl x0, #1 > ret > + > +.globl rdvl_sme > +rdvl_sme: > + hint 34 // BTI C > + > + rdsvl 0, 1 > + > + ret > diff --git a/tools/testing/selftests/arm64/fp/rdvl.h b/tools/testing/selftests/arm64/fp/rdvl.h > index 7c9d953fc9e7..5d323679fbc9 100644 > --- a/tools/testing/selftests/arm64/fp/rdvl.h > +++ b/tools/testing/selftests/arm64/fp/rdvl.h > @@ -3,6 +3,7 @@ > #ifndef RDVL_H > #define RDVL_H > > +int rdvl_sme(void); > int rdvl_sve(void); > > #endif > diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c > index c90658811a83..9bcfcdc34ee9 100644 > --- a/tools/testing/selftests/arm64/fp/vec-syscfg.c > +++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c > @@ -51,6 +51,16 @@ static struct vec_data vec_data[] = { > .prctl_set = PR_SVE_SET_VL, > .default_vl_file = "/proc/sys/abi/sve_default_vector_length", > }, > + { > + .name = "SME", > + .hwcap_type = AT_HWCAP2, > + .hwcap = HWCAP2_SME, > + .rdvl = rdvl_sme, > + .rdvl_binary = "./rdvl-sme", > + .prctl_get = PR_SME_GET_VL, > + .prctl_set = PR_SME_SET_VL, > + .default_vl_file = "/proc/sys/abi/sme_default_vector_length", > + }, > }; > > static int stdio_read_integer(FILE *f, const char *what, int *val) > Looks good to me. Reviewed-by: Shuah Khan thanks, -- Shuah _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel