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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 BA13DC433B4 for ; Wed, 7 Apr 2021 15:58:32 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 572E061132 for ; Wed, 7 Apr 2021 15:58:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 572E061132 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=desiato.20200630; 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=z/x15tDHQ7YYkq2qYWrey3B8YbXvdiqlmZhjdJEery4=; b=LKx11lG4+o4TshXrwnu25An1/ CSEKNDm5od6zQlxxkWzqR4WXM3/9wFZKlFYcqYe44MnHGjoLde8UIHaTiVe2lGqJQqZWkZ060QFuf Ftf1Ap574NQJwCa6NSZ4jTrXau4A7yOsGWdcQe9zaGNe3B0k43vvIcvECEH7NYqpgWK1ACOlxnf/l tgeR48VKk+ykWObnURmlwqT81uhZla2WjePdEnYXlO9WtvjhG4h5sY589gXBBBW81hhURA3qG2Gb9 PCcFWa64ON/f263ybFNxZkqWP4tUanB2HGaYXUhZ67PsZVPhSZ2vQmDb7xFJxq2mhZ+YW9p+ZIObC xNY3NMxjg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUAXI-005LsS-VL; Wed, 07 Apr 2021 15:56:09 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUAXB-005Lpy-Hk for linux-arm-kernel@lists.infradead.org; Wed, 07 Apr 2021 15:56:04 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C9D2613CD; Wed, 7 Apr 2021 15:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617810957; bh=8ajWP5YUar0B33sW8jtPUA5+9dgdibloj6O4pLBeQSk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WYMjdgiR9jrNjliCmJW5YtywOENfXEYDV/qL/5cg9iuGR2oITawxELEW4b9ZDSKJr 2M8y/Oc+69/r5cfs3VvGT60kiwa7UR1jF421TRunCFLe9ekV+UK/DFOi0z1Qkj6PKS 6xjkXlq2AFQhE4mR5ps7IfcrEJ0n1zDr2yV4TF0dYLK/p8EeedM62+UZMqrRUi+n1U PODQjAqM2StI6fB14nCBcvpZMFd0f2g+BK1W64Z84q+Xyf4JTeBnMVptopLwL4dS2n 3xdXqhLu7qS8EBcVsiURbN4EvSdx7KyUsWWy2XaQo5+2k0c3OkOdksH0rGDCUOaiLS t1reG0gMABgwg== Date: Wed, 7 Apr 2021 16:55:39 +0100 From: Mark Brown To: Catalin Marinas Cc: Will Deacon , Julien Grall , Zhang Lei , Dave Martin , Daniel Kiss , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64/sve: Rework SVE access trap to convert state in registers Message-ID: <20210407155539.GF5510@sirena.org.uk> References: <20210312190313.24598-1-broonie@kernel.org> <20210407114511.GA21451@arm.com> <20210407124806.GC5510@sirena.org.uk> MIME-Version: 1.0 In-Reply-To: <20210407124806.GC5510@sirena.org.uk> X-Cookie: Dry clean only. 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-20210407_165602_857236_D822D9E9 X-CRM114-Status: GOOD ( 15.81 ) 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="===============4989143579648760521==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4989143579648760521== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7cm2iqirTL37Ot+N" Content-Disposition: inline --7cm2iqirTL37Ot+N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 07, 2021 at 01:48:06PM +0100, Mark Brown wrote: > On Wed, Apr 07, 2021 at 12:45:12PM +0100, Catalin Marinas wrote: > > via do_el0_svc(). So it looks like we may restore some old SVE state > > after a syscall (maybe I'm missing something but it would be nice to > > follow zero or preserved approach). >=20 > The state is currently converted via the fpsimd_to_sve() call in the > trap handler, that *should* be dealing with anything required for > conversion. You're right that this seems to miss zeroing anything > outside of the values it immediately writes - I might be missing > something though. It's only going to leak information from the current Actually I found that we do have the zeroing - it's done in sve_alloc() where we either kzalloc() a new state or memset() an existing state so that's covered already --7cm2iqirTL37Ot+N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmBt1fsACgkQJNaLcl1U h9Dpdgf5AfHBfCNdxeuBhQLpqv+Hx7RywGykIawqzYnLZNVqWmwcnSdWYw6blbqp w3NyaNBk8nYH5cp9K54t/R/HZjS7KaGpFuQmqFP3FNRYfjcPnadHoZEy4uoBraZq FRj6HCvi/OLHMIDj+nbpF3xmZhhz6n4C4lduJ0adcnsy7tO+0Ahi4mevhJACOzca igk1rJV3eSGd9LdB76uaPtkWrvt1+Fjz02oRfd5SUW9MFCabR7wMrpyeaCA57LGa Xq+iSEefSemR5uBH3XDJe0ubM06NgmLtszUwdlwuKq76OvxU01veWL5I2/8yysfj H6Ji2FQZfVarYY4UOGEDU+OPoDPswg== =l3Rs -----END PGP SIGNATURE----- --7cm2iqirTL37Ot+N-- --===============4989143579648760521== 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 --===============4989143579648760521==--