Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3511545rwb; Mon, 7 Aug 2023 15:04:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3TUA0lzR/3aEkx54rByIoPV8CCsAD2Z5qc6lfFCnFX/axcI2B/ywIK1yREUoJAICIjwrm X-Received: by 2002:a05:6a20:3d84:b0:13e:8ce5:bedd with SMTP id s4-20020a056a203d8400b0013e8ce5beddmr12668648pzi.1.1691445849346; Mon, 07 Aug 2023 15:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691445849; cv=none; d=google.com; s=arc-20160816; b=lzwrEc6QINw4E848bLGxNiVODWWi5VorLxQNVkiAnHU6OZEzJbEYayH7H6JUm0vKQI 9YMEZGRxJJ6u0NQkEPtwB5RwZSTf/n7QLyEPiIDjtxSU37RDBodN/w1gFbqh3jRO6wFi +p6KD99o+CzBLpcMbE91T7Kc1mWj6RcJzEFOoSwIoq7nHOAZPjgcTIaqLo/t/XyyHYuv 6M104FqmZlSieVkBnvLMj3NrZ7QZVPgd1Z9ez0BwMLyKWCcTUb1NF//cVz+pqoRaFyuE sSgnMY3RdjaAFUqrNV7aeRrOetIMJsZl69MSTAN9iYWg+Zz4tcybazOEJp+6c4TKzxZT nVfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=9EiokGlVijer87hj8YWJ1OH7aG1LYVUNBq6hLY0xJSc=; fh=EdAFSmIgUzZTC6WCy4Jg1wBZ0/m6m2d/OjiRUJ3BsTI=; b=Jp98KYNgJz4/hfhF90ncbLiYaosIj5vByyE3QDniHmWXbymQMW1C5wGLS/5SgdCj9Q wZ6+VGD1hmhxYK1XA2t8OiEo649fh80+HZ24McvjXgVmetTbUpWFJYukAxJD3BFvvdKv OxvB0T8GBQ/Y6p+dORKjindWJpXnohLpyIKYApVExIOCQNWkkte9Iwd7LhbyIPLqJr4O XolV6MnMqln5SPgAZ8vL+Zfh0aLN60dXi65afFVl3/UNp2Jgyia5a6oWNaSyk7qyVKBv Mtwt/Up9bNM2Vnjam0Lf3GfKEela0dtulXoxV9v3UfSD20FEG0IDcvcZJQvHNUDVEI6m Iv/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Th1Z9bVZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h26-20020a63f91a000000b005644828d510si5975998pgi.670.2023.08.07.15.03.57; Mon, 07 Aug 2023 15:04:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Th1Z9bVZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjHGWBz (ORCPT + 99 others); Mon, 7 Aug 2023 18:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbjHGWBv (ORCPT ); Mon, 7 Aug 2023 18:01:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 779F6DE; Mon, 7 Aug 2023 15:01:45 -0700 (PDT) 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 740B06223A; 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.30.2