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 B9B69EB64DD for ; Thu, 20 Jul 2023 11:35:28 +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: 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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=b1omXKuHMTq0G04CcTZik/Y+ctvlxrjJNVNhDXUJ53U=; b=Qk4/CxDntJGQsVYPn+eYL8UooZ XMRM81Hn+jEZ1pFP9eckpKQvmMy/0rtdYFENIF3h76vwDyptKQHoD7yO51s1YDCejjSGLUEjR8ndd 6xCEehsGNM/7TlYKjNLCtFBtgrpMFj5lz3WveJA40l69kkZZbc1HVtLnlX5fN0U3vWm1qtg+QGn+y aq9XEDRQtOnnHQfJ8rYgkotUdyzjkZ1dhTM23aATidjOe/pBIuQkExOcHRpNEq2NEg4KkORKk2iJH HRfCigfx+vr0m2uiADIhgEOQH0yzcX7OXQyRKarWxP/bbDtrKkaVhx7rAnc8PTPZ3OTeUs1tKhEEB Pb4JuDFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMRw7-00Azbr-2n; Thu, 20 Jul 2023 11:35:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMRw4-00Azar-2W for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2023 11:35:10 +0000 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 5B9F661A40; Thu, 20 Jul 2023 11:35:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A46CC433C7; Thu, 20 Jul 2023 11:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689852906; bh=nCa/1RnSN1PvAEqgZ6aBg7wOWjtKMWsXJd5ab65Fd4s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CLPZcIE4fJNecqV+OQQNcp2ow6XvQ5cQlpBsSlRjZkeYbBvtgEwpC97S7QEGt18ev PK9Du22sqZc9dKNubjxc1N3h6mSKTvpMAD2dLbmPhLuZd178fH+nYturxidi3gIddF KYiGTB6z16jRf5/Fs4fLTWTemNsC9cfEbrO0GFfNfOAk8+/5jJUgp10CR4yIiGyG4o NX4GJIA9+e4XDK261EUf8wIwsu3Wxx2xX4NaQhni1ePoNiTG4t4Y27vESsRO7SIxwM TEDfffhxTXO7sL2ptOwI2pIF3x31y/z6BtG6cA02tM4WFVMbc/yGTbbxaDM3p3cL2e J+ZjBZcI5yGYg== Date: Thu, 20 Jul 2023 12:35:02 +0100 From: Mark Brown To: Will Deacon Cc: Catalin Marinas , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2] kselftest/arm64: Exit streaming mode after collecting signal context Message-ID: <037425cc-bf17-4dfd-8bdc-c1c10b153ebb@sirena.org.uk> References: <20230712-arm64-signal-memcpy-fix-v2-1-494f7025caf6@kernel.org> <20230720103113.GA11034@willie-the-truck> MIME-Version: 1.0 In-Reply-To: <20230720103113.GA11034@willie-the-truck> X-Cookie: Ginger snap. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230720_043508_858847_01B787EA X-CRM114-Status: GOOD ( 20.92 ) 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: multipart/mixed; boundary="===============4170614429107433142==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4170614429107433142== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aTvBd9Kod+7PIAg3" Content-Disposition: inline --aTvBd9Kod+7PIAg3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 20, 2023 at 11:31:13AM +0100, Will Deacon wrote: > On Wed, Jul 12, 2023 at 12:02:30PM +0100, Mark Brown wrote: > > + /* > > + * This is a memset() but we don't want the compiler to > > + * optimise it into either instructions or a library call > > + * which might be incompatible with streaming mode. > > + */ > > + for (i = 0; i < td->live_sz; i++) { > > + asm volatile("nop" > > + : "+m" (*dest_uc) > > + : > > + : "memory"); > I don't think it's save to use "+m" here, since the compiler can assume > that the address is used exactly once in the asm. If a post-indexed > addressing mode is generated, then you can end up with register corruption. > Stepping back, why not use either barrier() or OPTIMIZER_HIDE_VAR() > instead? That should work. I was mostly just open coding OPTIMIZER_HIDE_VAR() and noticed that memory constraints were a thing. > The most robust fix would be to write all of the streaming mode code in > asm, but I can appreciate that's a tonne of work for a testcase. It's probably more proportionate to add a dependency on toolchain support for SME, but that'd mean we hardly ever run the tests. --aTvBd9Kod+7PIAg3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmS5G+UACgkQJNaLcl1U h9AozAf+OH5Eqn23Qm+63ObiLCOwb5H7h5wUqULh0kqX1taHNghmkpmsygGx4+At 8pix9qb7n5Bsdf3L1AUVx7CQVC51tdK5wAvDHSp0SzHH6a0wZUQwVn+4dvoMEsHq Q9GcbWrnsiel90Qqm3Pm2YaLNFo8pTIaK5GIqxcgT9n7pOQzRAcc3ixUnJE5Xy25 f5bwnT6MdzT5TXsT2nZ+wEx0TgfzS9Vg7qrTDhbOBlC+G3XJIwF2VPZkMO8JxBQ7 UsLPZ2Uj91aIXkTAcWKt8ZXlX7fnFJJUR5ffUTTYOsUPDGGqCt4kcC1CF9o5iang R01HmQW1d3sWP7emrRY5/9DsVM2xuw== =ys6l -----END PGP SIGNATURE----- --aTvBd9Kod+7PIAg3-- --===============4170614429107433142== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4170614429107433142==--