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 X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5191C433E0 for ; Wed, 10 Feb 2021 19:55:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65CD564EE5 for ; Wed, 10 Feb 2021 19:55:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65CD564EE5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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=NxoxzbCLA3sMjJSs+Z1OkenkHt7s63uG9dWAFuKBATY=; b=RZqGW3vz8iiCANU6eOjQTVRT/ mbqj5j4uVP/EzfFbEbyw+f24rDViMQWa4YuweWS3SWkGwKaMRP1D4lCgj/AE5cDC4JH/L8yHHWQdD cyLY3+icBSnXzrw4AKwYSrvk6ocF9UJ0n/zOfokfuPuVIHNrAPc3CesTK1wMjm7O0vF/K02N5HxFQ ia6dNQGWIo9DNBH1+6nmPbUieLnfTwzXLc2TSUXd3Gd97JozjvcuNTFyl1D3fNjGIEfdwtbuG+Mp7 /udSfDFvL4tjWfflAVOF9h7k/i+ObXlpkW+Sz91qqS6Al7YD0TvgL/basiGorapnxCVatqjK30rLP 2GNBJXOiA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9vYQ-0007zV-2V; Wed, 10 Feb 2021 19:53:38 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9vYO-0007z9-08 for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 19:53:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id CAF4D64EE4; Wed, 10 Feb 2021 19:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612986814; bh=PaYbsmboPCV6ViInRDdNGjIjWl/PTthjUL23JG+pPug=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=n27c2QKlY9DvDzr5trRPkM3Cu2oeNEARVWEamaOx/oL4hPUJ9beM3SCh0qQi0xwio e1rxLyUIvFE0cwqFC8UXiPuUM/saVqfN9q6E2i5j3yD3Jg6PL5c3mUBtmMba3JOBPw HIcygQfhyNPhUlPw2E+EzBC5QOFRGSo9hkwOmmonZdtPqeluKNfEwaP2JsvGb3BseL abV8S1lucWpd2sAoG1kNZ4JV7gfBw2Z+hNwSJpn6ANrqrBPlFdUMmfQn0haXS4CYth V8fKDlcRmk7q+4jlrja9N44tjJ3dpq+k9pwxwok+Ik4jFiBJEV3G17aYwIw+Tl42Wl NRWLH46Gh3hEw== Date: Wed, 10 Feb 2021 19:52:41 +0000 From: Mark Brown To: Dave Martin Subject: Re: [PATCH v7 1/2] arm64/sve: Split TIF_SVE into separate execute and register state flags Message-ID: <20210210195241.GF4748@sirena.org.uk> References: <20210201122901.11331-1-broonie@kernel.org> <20210201122901.11331-2-broonie@kernel.org> <20210209175943.GH21837@arm.com> <20210209221627.GB4916@sirena.org.uk> MIME-Version: 1.0 In-Reply-To: <20210209221627.GB4916@sirena.org.uk> X-Cookie: Are we live or on tape? User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_145336_115223_0D65893C X-CRM114-Status: GOOD ( 16.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Julien Grall , Catalin Marinas , Zhang Lei , Will Deacon , linux-arm-kernel@lists.infradead.org, Daniel Kiss Content-Type: multipart/mixed; boundary="===============6364378766888087300==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6364378766888087300== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3yNHWXBV/QO9xKNm" Content-Disposition: inline --3yNHWXBV/QO9xKNm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 09, 2021 at 10:16:27PM +0000, Mark Brown wrote: > On Tue, Feb 09, 2021 at 05:59:46PM +0000, Dave Martin wrote: > > > @@ -952,8 +1022,9 @@ void do_sve_acc(unsigned int esr, struct pt_regs= *regs) > > > fpsimd_flush_task_state(current); > > > =20 > > > fpsimd_to_sve(current); > > Hmmm, there's a latent bug upstream here: if the WARN() fires then > > sve_state is not safe to dereference. But we already did. > > So perhaps this should have been something like: > > if (!WARN_ON(test_and_set_thread_flag(TIF_SVE))) > > fpsimd_to_sve(); > > This might make sense as a separate Fixes patch to precede the series. > Yes, that's definitely a separate fix I think. Actually now I look at this properly I think that we're sufficiently confused if this happens that it's not worth worrying about avoiding the conversion. We already did a sve_alloc() which will have either allocated SVE state or dereferenced a SVE state pointer that was there and pointing to freed memory so we *might* be OK and if we're not then it's too late to prevent anything and we'll exit with TIF_SVE which will have a high likelyhood of leading to future dereferences even if we stop this one. It's not clear to me that we're helping by potentially leaving stale data around so I'm inclined to leave things as they are. --3yNHWXBV/QO9xKNm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmAkOYgACgkQJNaLcl1U h9C/zAf9EliFNyWiGT7RMkL3xuXBccjQwjzUXFiO5oN2NGTatWyxKwoqZ7fFNhRv +GlrLCYgx99VqdvwHEY2EmHE5nvZkGwDQgzCAUjj4S2O/ZENjsT7wNeNGIBKsaG6 UXjZxCNNHw9vqO0eK7scppvpYlZRmygwfVRX9lRufEwv6eGMdOPBSZvzxY+ucc2b M+KtI7GRS1a18OX9gb4yRF9Ke6LZeBYeM4CQmlSDlNADlQzTcIpezkyW9wf2eTkw Oet1VbJkRw+Z4SuzJ340vYL98u8rmzGXDJrTtMInoT11RvpYudgNApH/5lAxdepL FrLdqwId4LNjvCWH5DnHLuLMw5f2MA== =UNFo -----END PGP SIGNATURE----- --3yNHWXBV/QO9xKNm-- --===============6364378766888087300== 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 --===============6364378766888087300==--