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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C66E9C52D7C for ; Thu, 15 Aug 2024 18:14:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 610486B017D; Thu, 15 Aug 2024 14:14:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 599666B019B; Thu, 15 Aug 2024 14:14:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 462306B019C; Thu, 15 Aug 2024 14:14:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 25A366B017D for ; Thu, 15 Aug 2024 14:14:18 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D254A141758 for ; Thu, 15 Aug 2024 18:14:17 +0000 (UTC) X-FDA: 82455279354.07.0CAA7F9 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf15.hostedemail.com (Postfix) with ESMTP id 52C60A0009 for ; Thu, 15 Aug 2024 18:14:14 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BdNX9evY; spf=pass (imf15.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723745598; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8S7fVFqbqPfAafRih8q/yQy27jhQ3dfjaKH6qLF2Qpc=; b=tX6Hc2v8kFj2indTVmTW/aaYDk1SuMdsLJ8Q4c2D9rIFVoalm0/A+Gj0Yu6fHdF4C/O+Zb 0UJMKDf8Ps+vkCCeMKk30GZrOPdvzh1VmVhAnrZTsM9mUQFeK3/2WI8se/gZJx6qViREcC qHan2s0KF8VCLwGAEUANXBIzyxu8gOE= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BdNX9evY; spf=pass (imf15.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723745598; a=rsa-sha256; cv=none; b=vvEf0c1pcNgJIxVZitz93Gx8qQ7IPDT92O7advtNV1EV5A1xSLwwUV/bTMlF46b1lXKwG/ WQRPR5iqP9k2HulfKlEWVymmYx57SMgqwIfUfd2xWaflRArWi+ddMNCUS9FarWZOACQFn5 /TMqfRohEhTZn7ES+U9U/gJurDKOnuA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E7010CE1DA0; Thu, 15 Aug 2024 18:14:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB208C32786; Thu, 15 Aug 2024 18:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723745650; bh=RdD04e7bCL/aVp7Qyn7v8N5dBB4gbycSkh4w1YVB2kc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BdNX9evYkuNDzaq1aPNqEDzPM6DtOszJ4fplPAv3RtWa/vIKvYlrUd7AEi63DCqnj 2ZHmYP3Mhcaxzc3nkhhYZ1sezN/Rie/qqCA2LjgDHrNdp4aniD+lgSn90u0O5kM7ub snWnOv3YaUWn+8rZfdCes1OgLfN4geXYsjJs0xIw8WKiccSuMwsIWlS78BoWm1udr5 UeaJIwcpXPwSXqFL0Pwut4my0L7CtbUI9cXNk0RIPALppzDzDXQ+apnvBxCP1QHcnu jG4F5HHXQ7kK9LxOGpKf1DPtz/YzKtlDkJS45/ImafzJCEnmP7dkyB5UYYS1dl2xf4 XKP/epYAVeuMw== Date: Thu, 15 Aug 2024 19:14:01 +0100 From: Mark Brown To: Catalin Marinas Cc: Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , Kees Cook , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , Ross Burton , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v10 04/40] arm64: Document boot requirements for Guarded Control Stacks Message-ID: <44ce87ea-38c3-4a84-9dac-835b963ed07d@sirena.org.uk> References: <20240801-arm64-gcs-v10-0-699e2bd2190b@kernel.org> <20240801-arm64-gcs-v10-4-699e2bd2190b@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FolSFB1sscROoe34" Content-Disposition: inline In-Reply-To: X-Cookie: -- Owen Meredith X-Stat-Signature: 6rxppeq4mtkr1aq8htk39dbfxkg9t9n6 X-Rspam-User: X-Rspamd-Queue-Id: 52C60A0009 X-Rspamd-Server: rspam02 X-HE-Tag: 1723745654-706097 X-HE-Meta: U2FsdGVkX1+RqYwgmxpuvn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wFNbSmz/HPhRrjTOr5oa0IR9HmTRXTbXSVx0JN8m3u6KdxfvqeR2lVWJvuvfrEzGHIFMd7uh+xdlG+3ANBbh9HAND9zmt+3rqwZIfSbRy83QuzC3/NYvQYAOpfrJwq3ACAE6bg+sCA9AEa9z46WOhB/1qfpK3WuBj9Jf3sTHU0zamDPOLo2ueT9TOTDVPqLMHmGZQKF/5K+n/tZ67slNbzbcZ/FztQAHskLuw+YVZcry84JkLjxJD2l0D67+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --FolSFB1sscROoe34 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 15, 2024 at 06:00:15PM +0100, Catalin Marinas wrote: > On Thu, Aug 01, 2024 at 01:06:31PM +0100, Mark Brown wrote: > > + - If EL2 is present: > > + - GCSCR_EL2 must be initialised to 0. > > + - If the kernel is entered at EL1 and EL2 is present: > > + > > + - GCSCR_EL1 must be initialised to 0. > > + > > + - GCSCRE0_EL1 must be initialised to 0. > Currently booting.rst doesn't list *_EL1 registers to be initialised > when the kernel is entered at EL1, that would usually be the > responsibility of EL1. The exception is some bits in SCTLR_EL1 around > not entering with the MMU and caches enabled. But here I think it makes > sense to add these GCS registers since if some random bits are set, they > can affect kernels (and user apps) that don't have GCS support. Right, exactly - the trouble here is that if we enter EL1 with GCS enabled we aren't able to do function calls until we either disable GCS or configure the MMU and allocate a GCS. This means that all existing kernels which haven't heard of GCS require that GCS be disabled prior to starting, they'll just fault within a couple of instructions whenever they reach the EL for which GCS is enabled so it seems sensible to just require that this is set up. It is hard to envision a scenario in which it would be reasonable to start in a different configuration. Now I think about it I should move those two to not depend on EL2 being present, that's just cut'n'paste. > Don't we need HCRX_EL2.GCSEn to be set when entered at EL1? Yes, if we want GCS to do anything. I've added this. --FolSFB1sscROoe34 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAma+RWgACgkQJNaLcl1U h9BaiQf9EC6tNrCibHFhHciYydBCLiy2LIqlYTMYVmhIGoRxyAWDvgrDDiZx9XtM yJHys2Cn+xNukEZmz3TbAjtEfCb32S5qodYU+8KsRFp6cIsM2kUCTkFdVTz36dMZ 8IDl4I2zbMlh03uCCC1+5vjuXE+qRPgUOzg1X00q4zHYC05XoSWCm2I1183TgHKJ 4INAGk/sLjwF3oZPOtjnIta/ZUqyrxLbcBH4b1JQQD3WZ34WHJKjbCiZigQYJIMh iy9ryfYUrf8oluuAuFO8javORaHNBURd9bOsjj004eD9WlKYjp1Ji7iuheq5iWb6 A3XUg+P7gC0bMfb12d1321Rjg8cWng== =dtpa -----END PGP SIGNATURE----- --FolSFB1sscROoe34--