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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF1CEC433EF for ; Thu, 9 Dec 2021 17:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238645AbhLIRJn (ORCPT ); Thu, 9 Dec 2021 12:09:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242213AbhLIRJX (ORCPT ); Thu, 9 Dec 2021 12:09:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD25DC061353 for ; Thu, 9 Dec 2021 09:05:49 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 81546B825C2 for ; Thu, 9 Dec 2021 17:05:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16A7AC341C3; Thu, 9 Dec 2021 17:05:44 +0000 (UTC) Date: Thu, 9 Dec 2021 17:05:41 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Shuah Khan , Shuah Khan , Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v6 06/37] kselftest/arm64: Add a test program to exercise the syscall ABI Message-ID: References: <20211115152835.3212149-1-broonie@kernel.org> <20211115152835.3212149-7-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211115152835.3212149-7-broonie@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Mon, Nov 15, 2021 at 03:28:04PM +0000, Mark Brown wrote: > diff --git a/tools/testing/selftests/arm64/abi/syscall-abi-asm.S b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S > new file mode 100644 > index 000000000000..983467cfcee0 > --- /dev/null > +++ b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S > @@ -0,0 +1,240 @@ > +// SPDX-License-Identifier: GPL-2.0-only Nitpick: I think GPL-2.0 is sufficient (i.e. no '-only' suffix), though about a quarter seem to use the -only variant. > diff --git a/tools/testing/selftests/arm64/abi/syscall-abi.c b/tools/testing/selftests/arm64/abi/syscall-abi.c > new file mode 100644 > index 000000000000..d103acf1ab79 > --- /dev/null > +++ b/tools/testing/selftests/arm64/abi/syscall-abi.c [...] > +static int check_z(struct syscall_cfg *cfg, int sve_vl) > +{ > + size_t reg_size = sve_vl; > + int errors = 0; > + int i; > + > + if (!sve_vl) > + return 0; > + > + /* > + * After a syscall the low 128 bits of the Z registers should > + * be preserved and the rest be zeroed. > + */ That's the current behaviour I think but the sve.rst doc states the values after syscall are 'unspecified' (same for the P regs). Should we tighten the doc as well? A downside with forcing zero is that it may prevent us from some optimisations in the future. Currently we do an sve_user_discard() on the syscall entry path and disable SVE but we could instead do this only on context switch or when the kernel used Neon. Of course, we also run the risk of the current behavior (zeroing) becoming the de-facto ABI. -- Catalin 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 2B093C433EF for ; Thu, 9 Dec 2021 17:07:19 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8Ix6zRbCRSF6jArZ8c9cxtDrNfof3lXSF1HkbyNpTJ0=; b=nnPgAI5D+yf3FL RBBjeaFs4JLCEtSSriBKnA5CRV0IWffwEBPGHepnu5wX4VyvD3BBJcPvkLoWJeRcA3gb5mRorTSSI ul74UVn1FtzSTyECsR8C0pV4kLMAEL5d+ykBCk7zu6WuuSViXdDkgiPTX71O957hlPX79V3HIXX3N TrT4PLfoMTdd/7/7L8QVUlzKYWTkBfe1njg0xLHs9OfdEFYChk0Kca9Zj829Op7GAnmStsWmejOCP SbURxyX6ofsdJuCpuMRHMqoJ/ktEKm/HcJHH4BWzVSkrwBPKRlOy6ULHKbTdWz90V5ZXr2duPTzS3 vjl6g7s0OIlz8tfcxbYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMrr-00Gro0-I1; Thu, 09 Dec 2021 17:06:03 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMrd-00Grjw-AB for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 17:05:51 +0000 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 92058CE2758; Thu, 9 Dec 2021 17:05:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16A7AC341C3; Thu, 9 Dec 2021 17:05:44 +0000 (UTC) Date: Thu, 9 Dec 2021 17:05:41 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Shuah Khan , Shuah Khan , Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v6 06/37] kselftest/arm64: Add a test program to exercise the syscall ABI Message-ID: References: <20211115152835.3212149-1-broonie@kernel.org> <20211115152835.3212149-7-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211115152835.3212149-7-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_090549_577362_62DB293D X-CRM114-Status: GOOD ( 21.18 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 15, 2021 at 03:28:04PM +0000, Mark Brown wrote: > diff --git a/tools/testing/selftests/arm64/abi/syscall-abi-asm.S b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S > new file mode 100644 > index 000000000000..983467cfcee0 > --- /dev/null > +++ b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S > @@ -0,0 +1,240 @@ > +// SPDX-License-Identifier: GPL-2.0-only Nitpick: I think GPL-2.0 is sufficient (i.e. no '-only' suffix), though about a quarter seem to use the -only variant. > diff --git a/tools/testing/selftests/arm64/abi/syscall-abi.c b/tools/testing/selftests/arm64/abi/syscall-abi.c > new file mode 100644 > index 000000000000..d103acf1ab79 > --- /dev/null > +++ b/tools/testing/selftests/arm64/abi/syscall-abi.c [...] > +static int check_z(struct syscall_cfg *cfg, int sve_vl) > +{ > + size_t reg_size = sve_vl; > + int errors = 0; > + int i; > + > + if (!sve_vl) > + return 0; > + > + /* > + * After a syscall the low 128 bits of the Z registers should > + * be preserved and the rest be zeroed. > + */ That's the current behaviour I think but the sve.rst doc states the values after syscall are 'unspecified' (same for the P regs). Should we tighten the doc as well? A downside with forcing zero is that it may prevent us from some optimisations in the future. Currently we do an sve_user_discard() on the syscall entry path and disable SVE but we could instead do this only on context switch or when the kernel used Neon. Of course, we also run the risk of the current behavior (zeroing) becoming the de-facto ABI. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel