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 EF319C61DA4 for ; Mon, 6 Feb 2023 13:03:45 +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=GxmaE1Z3j3H8NILqCAamec9fAeKOxUSsyIKedJcWQVU=; b=LAckjaiIlvxK1lfizgdqcfLbLO IEsNhg6cipO4InzvD01LMw+Ny8vhgoEZ/kBY5HjgKh0qhzWd1NkJ34P04gl3xr6wseayMcjXkSYN6 TPrtNZUK2OyCLUW5xa6ZNquGRe+8EfoBJ0fBDC9t8Z2f5Or40g78cYVnzlLbTTj6wchrc0XrfYTGF cM6EndJ9tFYCGTAVwuM43sXDK14GWBhR8m0G+5osK7yaDV3YLKblfxjuaFUPbRL0zvl7SdMFlioWB Ot6UAyLCEpX5vyQjO+fcy5SfFM6AM/4oB3mxe0GPMotLEJzzhXuS+6NKZn2S6g1h+hB3+homN+CvP /JYt3LJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pP18u-008ZaW-Q2; Mon, 06 Feb 2023 13:02:44 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pP18r-008ZZi-QK for linux-arm-kernel@lists.infradead.org; Mon, 06 Feb 2023 13:02:43 +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 dfw.source.kernel.org (Postfix) with ESMTPS id AA4F660EA2; Mon, 6 Feb 2023 13:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1556C433EF; Mon, 6 Feb 2023 13:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675688560; bh=tJmujHmJcFdKVliYWHuZ3IFNjgrhKrrGtfsWmEgSqkc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d8HW7sAH0SbCtcMu0ADg7/fZAnIawCqxfE9Om4v+vWLAzpnp2qannalR338lhxoTi Ej6THKSMlLieGy9PVuUxRIy/KVhgeUhhbHW/2boQUxLYRpZY8cVHVojvpSrZ45An+V OuyPq8qnIO8VFA7nmvYLOiVSzYNnLVoYOV7s53bH3A7kBMyWwrhGr+VXt1g9MfhoBx gHMUmghNkiwpAW2u48OQ9oacXygl0Bs38F1br3WjPxakY+VEtd3RcmyM5X6TclEZm9 kSlfWTALaUoAtwuc6fWT3EBHqLU8z5HgLChBYTMc/Ed8GxHsKQKZx1crlYHoem1+2K Dy72Kd/cN9YnQ== Date: Mon, 6 Feb 2023 13:02:33 +0000 From: Mark Brown To: Marc Zyngier Cc: Catalin Marinas , Will Deacon , Oleg Nesterov , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Shuah Khan , Alan Hayward , Luis Machado , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 07/21] arm64/sme: Enable host kernel to access ZT0 Message-ID: References: <20221208-arm64-sme2-v4-0-f2fa0aef982f@kernel.org> <20221208-arm64-sme2-v4-7-f2fa0aef982f@kernel.org> <86y1pbywbb.wl-maz@kernel.org> MIME-Version: 1.0 In-Reply-To: <86y1pbywbb.wl-maz@kernel.org> X-Cookie: Hope is a waking dream. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230206_050241_930333_503F5249 X-CRM114-Status: GOOD ( 18.51 ) 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="===============4911226800134669297==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4911226800134669297== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pxpYawn5NK0KvypX" Content-Disposition: inline --pxpYawn5NK0KvypX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 06, 2023 at 09:31:20AM +0000, Marc Zyngier wrote: > __check_override assumes that the ID_AA64SMFR0_EL1 value is in x1, and > I guess that the intent of the code is to reuse value read a few lines > above. But as the comment says at the beginning of the macro, x1 will > be clobbered, and the checks always fails. Yes, it looks like this is a victim of rebasing - I didn't spot the change to make x1 clobbered when the override checking was refactored. Thanks for spotting this. > I presume we're just lucky that sme2_kernel_enable() does the same > thing unconditionally, which probably means this was only ever tested > with a VHE kernel (it'd otherwise catch fire). Yes, I'd not be surprised if I'd never run this in nVHE. > The easiest fix is just to reload the id register before checking it, > something like the patch below, compile-tested only. Reviewed-by: Mark Brown --pxpYawn5NK0KvypX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmPg+mgACgkQJNaLcl1U h9CWoAf/autA/Mi++TtM0WfDO989RWtfdQeyfjo68JI2KAfuOS+EZzXsBI0tGWfa ZJekC2WlIZbo6gBAtDHT/+LspDthG2hQJXawXHy0bpG/YvLnjJvxo7KWTvO9szI3 m2BP5wL0O2McHI5RAbVvyCZS8VCvP0OeC5X5G9uYX7Plh51tNb/lMZUbTyJvxkTg WderG8+izuMhAYMSi7M5wuceSY+QO2sVLv/f2cFTVXFqDYpjmfyjhjhGi0zOGlUd XOk9iR9mg6PHs/RB4beUsxNJj5JQT9Du28JXmyG7iuLqrZN45TK3VqXKNk2dC+dV vwknsBbQvGLhcNCwsvb9DNCZS6g5pQ== =ajB9 -----END PGP SIGNATURE----- --pxpYawn5NK0KvypX-- --===============4911226800134669297== 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 --===============4911226800134669297==--