From patchwork Mon Aug 7 22:00:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13345067 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 756B5C001DF for ; Mon, 7 Aug 2023 22:01:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4B956B0075; Mon, 7 Aug 2023 18:01:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD4536B0078; Mon, 7 Aug 2023 18:01:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4E368D0001; Mon, 7 Aug 2023 18:01:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B1E766B0075 for ; Mon, 7 Aug 2023 18:01:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 807D5160B98 for ; Mon, 7 Aug 2023 22:01:47 +0000 (UTC) X-FDA: 81098681454.14.5421291 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id 57B934001C for ; Mon, 7 Aug 2023 22:01:45 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Th1Z9bVZ; spf=pass (imf01.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 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=1691445705; a=rsa-sha256; cv=none; b=fmUJb+HLYBnDlPRKnQhca1mT4EcJzuQv0S5ObHpFinzi/GA30WXIwDpfCeTYewX9WPQNw/ LPKTB7Daa9zmGjFrV6YscbK5hiQxdm7XRAEv1UZW+hzhCd/C6+mPJcc9GnJC9+0EqmQYsG WrzoR4Q0qQ1IGBdLiTP/0EEAKxqjTqA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Th1Z9bVZ; spf=pass (imf01.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 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=1691445705; 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=9EiokGlVijer87hj8YWJ1OH7aG1LYVUNBq6hLY0xJSc=; b=TVDAy23dGWEIxkp9hYsE0dOMRXwOVDXfMPnNTw5sdtOg3icD3jmU59YYnFzJFSyHe9xP2B LXezVQ4Fl43ZWedQfRN3l2+MnZsxYB9kdE2jR7LYX95CJ2eTxHkrjezpfXPBVdjqmYYVhC 9g5hXIF41QYemXyVndrzXShvPm9PYvc= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7445B62298; Mon, 7 Aug 2023 22:01:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F0BDC433B6; Mon, 7 Aug 2023 22:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691445703; bh=Z3injfV8td0LqFLeGew+/6AX1Y4kpAJIpTs5MPlZTRs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Th1Z9bVZmowOrXA//qqPzkg9/0FflEIxNHKJhCLc/z2CQKnCJG5DosJLmUmw+onOh 5wLMapny4nRmClsBtHWzRgWcJXonhkPSO7plqiyOioxX6Qcp0BvT/AF0SHf2sM/IMp EEY26EU0UBmOKFPHBAMR0lQykh44yiIDEHVxSv1jZVICoDECbdj7TX7aIaUxhuvfFK XyKCA0rMYu2wlIE8YWhBZ/zI0MdfI3gG4epqjukMR7Eiu/3uSA0dUimExMOs3+1h2n LEmAFbygEjYI8+6wW4f6U2Zu0TZdKx7s7Ayq57giRcnMlN//heaQNKqA+mNvFJoD0r Qn+uRSkkrlJsQ== From: Mark Brown Date: Mon, 07 Aug 2023 23:00:07 +0100 Subject: [PATCH v4 02/36] arm64: Document boot requirements for Guarded Control Stacks MIME-Version: 1.0 Message-Id: <20230807-arm64-gcs-v4-2-68cfa37f9069@kernel.org> References: <20230807-arm64-gcs-v4-0-68cfa37f9069@kernel.org> In-Reply-To: <20230807-arm64-gcs-v4-0-68cfa37f9069@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 , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy Cc: "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , 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.13-dev-034f2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1640; i=broonie@kernel.org; h=from:subject:message-id; bh=Z3injfV8td0LqFLeGew+/6AX1Y4kpAJIpTs5MPlZTRs=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBk0WmZbLyQWkqJ2tbfJHVr9HGRMWp3m8IuCBxbUpN3 n4AEtaqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZNFpmQAKCRAk1otyXVSH0EVvB/ 448mJqyXS/1bkj4UVvUEvHo+tLm9pbwH9qPL7ePhWt9agCi1fJ3JvunySZvTrX8Zho9v8xFt8Blvpo IGLmxat/yF6dJKfZitd8oFiPY3cyXLYyUTsiqAvGSn3eQhE7PBKDKLeZEFQ/5EtfUk8L16dNMWjEav qqN1kvOxX6qp9+KPrN8lcFPHRYvjeM3psViv9GfuFs6B2bA4FLjdvNgrH9yOW8o+pVsaZNxPwZmpdL 5bPOa43T95OYMnLHGAXje8MqHz0FGi+O9tUVO2NMSmMmjMnhFXzdMJtHkAcRqhw6yUcGkSykzK2sSI gI0CAqT/hhBf+DnJw394T4Q2tN4/vs X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 57B934001C X-Stat-Signature: 34mmfihe4bmwocg9cw1h48cb48d18r7q X-Rspam-User: X-HE-Tag: 1691445704-460190 X-HE-Meta: U2FsdGVkX1+MBxm8obDvbmCCFZqfQWhY0QJUhCEbNwE3ACPPBeFsGdvj6Op5/8w92VMQcr2XdQoILR2jtOKI/Npq/B4IzibcCmVnWfqmb7UVncuzHV31MJOr7dGJhuIC0UGSN8CtoztKHnsgcGOvXiEqqIT5HeEALBnkvQuone2i9e2l62SJrMUmjLzgKCU4UDE6FHPW/xSuFQ/W6kXvCEfn1uG6SLxi/FGNWdWSYH+Y7/sp+8uX0kktIXkNIYUI5NxV3GqhuX0K9Tdi+U1oDeF9l3q9VinyIxhMZKeSaUCziUpckWbZbissIbROR5prqXBy8cCgJF3rrR2Ir2/ZXFOOHK1wBzwIW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vUfN5DGrpHHQTMgM690KD8TFC89b7GF3+B0wdY0BdqEPxCcZ7Eoyx6ENA== 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: 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. Signed-off-by: Mark Brown --- Documentation/arch/arm64/booting.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/arch/arm64/booting.rst b/Documentation/arch/arm64/booting.rst index b57776a68f15..de3679770c64 100644 --- a/Documentation/arch/arm64/booting.rst +++ b/Documentation/arch/arm64/booting.rst @@ -411,6 +411,28 @@ Before jumping into the kernel, the following conditions must be met: - HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1. + - For features with Guarded Control Stacks (FEAT_GCS): + + - If EL3 is present: + + - SCR_EL3.GCSEn (bit 39) must be initialised to 0b1. + + - If the kernel is entered at EL1 and EL2 is present: + + - 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