From patchwork Thu Aug 1 12:06:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13750383 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 72621C52D54 for ; Thu, 1 Aug 2024 12:57:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 129F46B009D; Thu, 1 Aug 2024 08:57:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DB2A6B009E; Thu, 1 Aug 2024 08:57:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0BF46B009F; Thu, 1 Aug 2024 08:57:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D51DC6B009D for ; Thu, 1 Aug 2024 08:57:53 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9AE901C40BD for ; Thu, 1 Aug 2024 12:57:53 +0000 (UTC) X-FDA: 82403678826.17.BD9D6F5 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf24.hostedemail.com (Postfix) with ESMTP id 3711B180002 for ; Thu, 1 Aug 2024 12:57:50 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="nM/gS+qr"; spf=pass (imf24.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=1722517014; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=s1Apl5Jc/qwWGxy5IzIzCZxQzUVieWPUV/FiOQ2ejdU=; b=iVsZQzpFpYBNIz2Edo5Fy0rm3pRvJVh1CFzrLf7378jaKZkKJ8mHRQ13mmZ3N3a9huKqBA eKf1IqGvYMQOAnNJaC1N6UOZINe3CzeTOmDuTzUnRgLH291y+HnYLUA5KJRqjDNcszIyT3 kNk7zIeBtYxVfn9BOLAxbWpTYgqSJiY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722517014; a=rsa-sha256; cv=none; b=Uj54/c6Vy7Sg+B01H2EgYvvxyiQyh4AlP62WDYteuqgn6OjB9uOdMiMdaUyAnidJTyQcVt cN4VHvEt0NL52+PtiGvAlIyx8AzCJ6mm3qvKnIArKvauDMf/p8iEQ6raBt6w9YxV/N/B8J 7MhMyo+NGBKpU/dn+EQd3RTaYLA7Jeg= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="nM/gS+qr"; spf=pass (imf24.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 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 4BDFECE19B6; Thu, 1 Aug 2024 12:57:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB533C4AF09; Thu, 1 Aug 2024 12:57:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722517067; bh=3RZmbStJwVSGoP/qDNBFqPg5B/6FQNSgda/JKhBv7x0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nM/gS+qrFmEXsCA6RF2Xqdp3hb1CAKq9WGlHmbcwRTXnqJw63mJKa4Kb0O2iVyBX2 g+uUNVNRjO5ozwRIafO9FQN/TC2c9YJ54Kgb20htooXIcwdQdv0/WQvAb0B6YZiqwN V6Efuiql/CuGLVlN6wj5nbtZXYGIkaf7IyVu8aI2utkfhPBKvajQTPqGg1P5vk0rze 7MtTS4W1GnMoYc32N3Xl9mhD+/J57V+Rw0T3h5K0wrwT6eDPfmMWS/Bp6EviouyVku iYaaz+B9BVSeAENv0L1FLziwTmgtD7qWVp75kIlknntKSABmRyBsTOhcAkjitVxC2d oX1/sMdKfEtZQ== From: Mark Brown Date: Thu, 01 Aug 2024 13:06:31 +0100 Subject: [PATCH v10 04/40] arm64: Document boot requirements for Guarded Control Stacks MIME-Version: 1.0 Message-Id: <20240801-arm64-gcs-v10-4-699e2bd2190b@kernel.org> References: <20240801-arm64-gcs-v10-0-699e2bd2190b@kernel.org> In-Reply-To: <20240801-arm64-gcs-v10-0-699e2bd2190b@kernel.org> To: Catalin Marinas , 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 Cc: "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, Mark Brown X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=1946; i=broonie@kernel.org; h=from:subject:message-id; bh=3RZmbStJwVSGoP/qDNBFqPg5B/6FQNSgda/JKhBv7x0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmq4YJBO3yLLrkfe904+TZtJB1T9HeB08OFT8n6HhY M3NNmXKJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZquGCQAKCRAk1otyXVSH0B+qB/ 43pou9Y4TC/1pa0XTbag+sHQNoVFkuUIA8FSfx1e87YJGvqHTeNRK4JKwnIPZS8ZFD//FeU6sWUSfW yxOSuNd5EuCHGVVWwisTo696Z3sw6XMWW7d8fhRPIuFFtqtA6kpgUUm5VnWhlwsUMJLlyEvhPCLH9M W1uyrDqwl2iSR5m0UsF7EGNk5xhw5KPc8sOnTXdUsLVKW+omEqyEmUym6r/iwkWJKgT/pfEyZjPiOb 09Gkvy+2Bqy0iqZTzyLHdRiLMdV98L/zhHvVf6T0+hXGkl8wPotyUaXqIQUnOZ/tgnOUYdr26cwP2w XhAdMoByrIqOboCZuztVTcCPMQnZS1 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Stat-Signature: 4ns75d9qwsjt5hcj4eg3e5cqk6ctjc4c X-Rspamd-Queue-Id: 3711B180002 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1722517070-144604 X-HE-Meta: U2FsdGVkX1+yar5akzlheRLBHgo6sfyVImADV8RtpNOhIfd2U9qbvALsSl4656C2xfGb83cEXEBpOTuMs7V64iDoEXgUwArECy14nUI2fxg3XlCeJclocW7BVa0KdYxoNgsvgdWA4b7AW9u8FOsB8MHlOKjkCePFa3VJF++Lu2t/6/od2D9Ej8PzaFk2DI97ldWFS2WYdpiNZWoNvgTuUFY2VYqXDBwNGOZv5c0OJH9u+HO68ODQw7BzAxwqlKUnTrtzR7eh9KIS8JGqz2wGAp4l4Tpt9MRIRo1M6ML5u9TItTceh1dty4KUU0AN5fDyj2FWWrUivNevOmnHlG6lyDF/JIo53TW56leSR3EMzvhqgyrCydCPYssJg4Q41YisLvAWZc1WnzFE3C3AtI84Mmqzw7HsUEPm3ApxeSrmnlGFBYApTJj42Cgg5gR+ZrE/wf5x6JuH6/9TlFHt4nTyaBBsBrxmBlaM/U8Ov95U9yzeIlzT3R0rDmMNZlTg9Z4i2HzJCyC/iJfIw9fnZPeSc75Hx3gkZ5KeRbmI40NXHEKDSiAEGerhrmsv1iU0a2yvCO9B7F29VTwvPwquxVkRuEhU5/m1dXQeMnoujmCtWutTtPuSRN8B8Zp9JIri/7CyHv96u9VHQqI3JwImznxC+434yHsQ/VvER4684azssg23tRlhm50Fr8Pxl6SQdpeIh5/aTPP5R6SI0Ei8hJNOL1d7SV4dPMW9bG23V5kQ/8YxmdirCgzQr3DFRxbZDQk8RzgWvHy4j/zSo8XgugH53XIajaTA+Rknny6t2K3S87GuV7PSAyAr7lfmmvRLTG3k/p4zRxQL7KL/3/CBG1dXl9Hw3e/EyiRIMwhCGSpY8GewlUgjY1go3RUyy8CUX5XyT/tIaudINgTS89T1Efqz3KCM7nZSamZQRH48BFDc0GtKJgvUPtt+ZSrgOWRi8HeO0P0TAGhvPfwgKczcD/H R1xKlkHk HYW03ZRJMYs3EIVLYnprJoV4KDsJUOqmKsQ1zPh4ie5z1axuweauvcTcBUbgnD6rYp8pna/U9v3NMyJj3Ztg4IsMKc7sH6T1STy+w327Y0Wzm1BqXxjBwk8ymvnv1VTVbQg7p1j1qufoWm6RaORDSlaMiYAteHW9bVewn+CCVxGN7vFZsxoLS1r2tHptrIAa574BwQ0ITm2bgqdbd0AsOka8IPbTtcORqw/v3BzTKVDQJZEOVMK3M6klo9lJQxoTv+L+UFyupRXW3VqE+ZyvOGP1kWL6yAoO49C1C/6XC8no6dM3ERtueRdFpZGMS1JIlx1li 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: FEAT_GCS introduces a number of new system registers, we require that access to these registers is not trapped when we identify that the feature is detected. Since if GCS is enabled any function call instruction will be checked we also require that the feature be specifically disabled. Signed-off-by: Mark Brown --- Documentation/arch/arm64/booting.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/arch/arm64/booting.rst b/Documentation/arch/arm64/booting.rst index b57776a68f15..f5b8e4bb9653 100644 --- a/Documentation/arch/arm64/booting.rst +++ b/Documentation/arch/arm64/booting.rst @@ -411,6 +411,36 @@ Before jumping into the kernel, the following conditions must be met: - HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1. + - For CPUs with Guarded Control Stacks (FEAT_GCS): + + - If EL3 is present: + + - SCR_EL3.GCSEn (bit 39) must be initialised to 0b1. + + - 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. + + - HFGITR_EL2.nGCSEPP (bit 59) must be initialised to 0b1. + + - HFGITR_EL2.nGCSSTR_EL1 (bit 58) must be initialised to 0b1. + + - HFGITR_EL2.nGCSPUSHM_EL1 (bit 57) must be initialised to 0b1. + + - HFGRTR_EL2.nGCS_EL1 (bit 53) must be initialised to 0b1. + + - HFGRTR_EL2.nGCS_EL0 (bit 52) must be initialised to 0b1. + + - HFGWTR_EL2.nGCS_EL1 (bit 53) must be initialised to 0b1. + + - HFGWTR_EL2.nGCS_EL0 (bit 52) must be initialised to 0b1. + The requirements described above for CPU mode, caches, MMUs, architected timers, coherency and system registers apply to all CPUs. All CPUs must enter the kernel in the same exception level. Where the values documented