From patchwork Thu Aug 1 12:06:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13750394 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 499C9C3DA64 for ; Thu, 1 Aug 2024 12:59:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC3FB6B0083; Thu, 1 Aug 2024 08:59:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4E136B0088; Thu, 1 Aug 2024 08:59:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7AB16B00B2; Thu, 1 Aug 2024 08:59:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 836366B0083 for ; Thu, 1 Aug 2024 08:59:05 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4803E1A0502 for ; Thu, 1 Aug 2024 12:59:05 +0000 (UTC) X-FDA: 82403681850.11.1E4A856 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id 7BB7E40016 for ; Thu, 1 Aug 2024 12:59:03 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lsWmVmR9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722517138; a=rsa-sha256; cv=none; b=LME5x9ILRhh13/w2uNTHyXQD98JHp8PuN/yxes/JN1Awc8GMPnNfUO3lh8Rlwg+mJSXkcc 8I9CQYZJInUigAdSvoEGkP+zwH/ezvdzSMWTQhCXTxPSCfNLrLIhkIitYyZc5yCg7brcWA bzNS/ULULm6OY3Fd88REUXCANcBeR/o= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lsWmVmR9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722517138; 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=uSxBp1zAPNCG/WW+ciyc1p5hTF1NYzwRxhjEafzS+o0=; b=Mt83iI/zTFv05Orcm2yOMmGFzcpaWSxlJ6TelQucg2oo02mfOJUHS4+MdkHm0toMhU9MBz gyOeM9/uZ9rH6B6Rd/ZCf/LasExXB4M8pm/QKDFqYGCk07UW9vyCKb4D3JELb//inryqN9 +bJNSk+cvTndA+LYb+n/QoSwQc9yFt4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BE89262862; Thu, 1 Aug 2024 12:59:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1867CC4AF10; Thu, 1 Aug 2024 12:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722517142; bh=sqqkmEeL7tv5Wag3oPKgOfTAFLsGU8mgkKcr3MnXRIM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lsWmVmR9E2WgjWn+RgLL3PyZr6vGUhI7FHJzl1VUx+yXtAGp0+vgrsnRfEzxQPGF8 JEge+ccT2xkgSqTTKc43BQibLAN2Ff4RkJ4PJoSfiiHq36EdVEfRfqOICFTDHlyr8x GcgGDskfrMLd5JenB5QNSNHYQDdI7ih7Buhel8JcvWw7f6aINoluBytmA5D0QRg93r M4g7QjLRiu/6424aiBNTfRGzdx1eRsiBF6rKOsqNcy6Q0Pje228gBVVj5rtCSH76mR etppI/EaBZzCpoQY+V/GiPYFFQi1152aNx0npfmoX6t233KMZBi0w0WeQw939JZ31j Qp0K++dBcU8nA== From: Mark Brown Date: Thu, 01 Aug 2024 13:06:42 +0100 Subject: [PATCH v10 15/40] arm64/idreg: Add overrride for GCS MIME-Version: 1.0 Message-Id: <20240801-arm64-gcs-v10-15-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=1899; i=broonie@kernel.org; h=from:subject:message-id; bh=sqqkmEeL7tv5Wag3oPKgOfTAFLsGU8mgkKcr3MnXRIM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmq4YRVVwOZRbiJRdOh866tHwB9fWzGXz1GHzjC2YM YZxFiIaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZquGEQAKCRAk1otyXVSH0Ct1B/ 4i8fM2n38TeqWSOYLe9SGZf9V0EGaItvppKspC2O9Iz6LH2Ki3Uhm1aT8Y/219upgO0Pj+lApVwGQW NJoYZbJheeyUYExsZxy/tPp8NHS5vzITfA2Uauqqqc+Le+nX15+BzBtpIlqEe7FaW868OZNMz7+cUE NY5EGIt/Rkcvg5lO6Zh5mhBk+ERk9BTebzF7n2p4U6EdNmoBKBDo0Dc99B9jLdaalcDyZomv2B9i4f cUzrB3doruk6EOc7m8qoe84G8yflvsOjTcQ4weBKJmDitZfwE3twjnQBhTvlIrzzN2Ne4Xg4t040jI 8Txlbbf0NgH23Nmed0MqnbBcOo6gIH X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspam-User: X-Rspamd-Queue-Id: 7BB7E40016 X-Rspamd-Server: rspam01 X-Stat-Signature: b7oxezt6chudgnq5tuwp3j74k4659zb8 X-HE-Tag: 1722517143-842106 X-HE-Meta: U2FsdGVkX1+nWGlRAg9JsFJ6LpI2WPvDakqanXigk02cnIyW+1oNXntvCEfJPo5Jue9PvrLyjVVE6pQzg9B1hGI361HBJ27ZpV72u6NC1MCgMYOeJY6KmLqV3gNsxTo57stClSdI4GPJawCAr1E21gaSMsVeb9uuF7Aumdbcp9uiZojPL2er85BFQYwhBGzOQ2yrKuZ2hN/x6cFB8LGrSEmH2L7B2zBhx2Iygohohi/60VDx6NkS3v+XY5HgThZj2OWFHPh/OvhJM+7iRozh8vI1HzBLJoxzDVSsYYg7+VcKNLTmH3kwMRmwQV65BqvXd9dvKsdBXjSCuP0ea0VnoYnEt/LzfJ+fIqBxNwlTW4eZyaIwM8ShvshEOEHlqyTJYjlyOlyrgIURcb6U5rBEu9CL71zMd+xP1GGmXdFJxs5QAlN7gz97cugUi6bs9FpFRnxP/JxqStRy0sFE/hpjgEO8wdUpVImIWtYN95m9R6+vX+A/vn+aNi3Ey8+5JOKsnjWo8CBKkJGF85io3H7jKaRII98cg5URgTtqdDxDflyBgpXqBm3f8w03/qHrQkv2Xdb9KI9TxvWtsax1ChnrbCP0Bwoxa7V9Y18OMMLceNnUdBMSghNx4aCx/oDstfaihb4Tdq4ua7Mp3LDdVORuhV/ZYaMd++SmmoQ8S7qkujfiUvmSwuo5kqwZwGYQfNQfaUtK7Yj0ZpiZK46z7kdUYZpuRAZUbI1/cHcq3lBNMPjgLYnjeOG7c9MPXZ4HEldiDOU6YP18zaEKyf8pNPt6C8rbCT+0kTKW+GWWHNcZplKwWeutqFYsyTqpmKHcGypxuPUwG9+jmbPPZLAmRhWaTxrZBTqzfScnKGRuyOslvgTREGFWGGWfsgUWdud/9UJVHAo4MLb7O5LaYD8syReNN5gyOFvQOnuunvi7G+01+n0/4ruq2CRSrnNu4B1Wns/YUuFXwHQWmx8cqBJUKzh 09z7LXPV f/Qa/tTMQSoxTQtVrRaFkdxq0HESewUn8ugKlieo0LSWwSr7NX8rkr3UpRjTnA/41FLctfy3aQeDZh1rCBdQqqCgq17BoyZZmvlwNTZZdGlKQPu5ENyrgZxkf/Fns4z3qFqGQKzbMuk+VzX/Lkr+s6orDbtb50g1wUOTTs41mG0KI/DCfzVlyvqDsveHb2SxRLswQ9xmDYyDvxpFH4/B852DWzqRsKPbHHXTMPVZEI0MEt7GGcNaoR8fouVzKseFn5fs5n/LSYV1xXSkZImDUliRQwXZZ4hwk0OTJQ16PDoMQTbwdY/M6vvcS2NCZaVgIkAadnzfMNd40kEawlNjDHo24cWO8QTMVD2ARsJ0rsNAtK3DaOTwNzjMuAPxKPpvJHDe3 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: Hook up an override for GCS, allowing it to be disabled from the command line by specifying arm64.nogcs in case there are problems. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown Acked-by: Catalin Marinas --- Documentation/admin-guide/kernel-parameters.txt | 3 +++ arch/arm64/kernel/pi/idreg-override.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index f1384c7b59c9..3006c1bd1af0 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -441,6 +441,9 @@ arm64.nobti [ARM64] Unconditionally disable Branch Target Identification support + arm64.nogcs [ARM64] Unconditionally disable Guarded Control Stack + support + arm64.nomops [ARM64] Unconditionally disable Memory Copy and Memory Set instructions support diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c index 29d4b6244a6f..2bb709d78405 100644 --- a/arch/arm64/kernel/pi/idreg-override.c +++ b/arch/arm64/kernel/pi/idreg-override.c @@ -133,6 +133,7 @@ static const struct ftr_set_desc pfr1 __prel64_initconst = { .override = &id_aa64pfr1_override, .fields = { FIELD("bt", ID_AA64PFR1_EL1_BT_SHIFT, NULL ), + FIELD("gcs", ID_AA64PFR1_EL1_GCS_SHIFT, NULL), FIELD("mte", ID_AA64PFR1_EL1_MTE_SHIFT, NULL), FIELD("sme", ID_AA64PFR1_EL1_SME_SHIFT, pfr1_sme_filter), {} @@ -215,6 +216,7 @@ static const struct { { "arm64.nosve", "id_aa64pfr0.sve=0" }, { "arm64.nosme", "id_aa64pfr1.sme=0" }, { "arm64.nobti", "id_aa64pfr1.bt=0" }, + { "arm64.nogcs", "id_aa64pfr1.gcs=0" }, { "arm64.nopauth", "id_aa64isar1.gpi=0 id_aa64isar1.gpa=0 " "id_aa64isar1.api=0 id_aa64isar1.apa=0 "