From patchwork Thu Aug 22 01:15:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13772323 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 D4A17C52D6F for ; Thu, 22 Aug 2024 01:19:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65FF06B0102; Wed, 21 Aug 2024 21:19:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E8696B012B; Wed, 21 Aug 2024 21:19:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43B206B012F; Wed, 21 Aug 2024 21:19:25 -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 1E8836B0102 for ; Wed, 21 Aug 2024 21:19:25 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C0B2F1A1210 for ; Thu, 22 Aug 2024 01:19:24 +0000 (UTC) X-FDA: 82478123448.09.C6891A9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 0A89614001B for ; Thu, 22 Aug 2024 01:19:22 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ivuKgD4o; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf09.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=1724289473; 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=Q1jmjXB1dKcsmxay4HHVsYiRGo7XcyadV4Zv7PLXEyc=; b=3hFpytLtCDQEEeFfT49O/gDvPXuxWZgC+rJ1kLaZhklJvukchg0ZSIxMclLtUzWkt2fCvo R51BFYYSodODV0JfOAqiKNbUY0lSB+6BBpnz51MjhNZgYOXS/dArog3YefhYQr7r6RgRlp m64208gv3tGwUH4Woe4FFAvuTrTvKRM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724289473; a=rsa-sha256; cv=none; b=5f4CZZb23XuT5Yg/nVDO1eDO8K9vuRJ8vyJT6jUBPX8K+7xQ+LbRHBxyBHUnmAZgSdqLYB wmnl7Am9PWKCsiIArlyiwAp9G5cnQZco+0MFyHufPYH/YY7HQzwE3y4SnQ/JnV7RX9NcYd onEgOopFWijxMYsjJsMX9jy5gUT7v0s= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ivuKgD4o; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 405B0611C2; Thu, 22 Aug 2024 01:19:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E48B0C32781; Thu, 22 Aug 2024 01:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724289561; bh=sM6ARMSzs2g0dbHkgGbbEwKAjUQqEhC4Xbb3feAOKmM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ivuKgD4on+C7+YhBbtby4IvVq0RxF5/bBnr2MIUKiL3RfsjHRaLfUWjrd/hoOkypi e5oVdrksEIE09GHZZ1grqgllXSGlEDPePmVsU7M80fXrCJvMLa+IOAqlM1+qRPyefT NDUMeFDAHPBoXvktlWhOxdzO2rdFQlY178qnfUC3rm4Z+F/Utr6VLItE1zn9NpiWjM tyFC+TuvGcYhcMAJweOwV0VqEtP1ItN5OzDAcmWealbnPLZYZTVCmu5TDgUX36j+xm hBL+YaIBVHz4YB32atTfhUVZDEps5Lz+5jhEsIfqxzoZtgyLuLZph2EmpqaRb2tecw P/DJmri42EczA== From: Mark Brown Date: Thu, 22 Aug 2024 02:15:19 +0100 Subject: [PATCH v11 16/39] arm64/idreg: Add overrride for GCS MIME-Version: 1.0 Message-Id: <20240822-arm64-gcs-v11-16-41b81947ecb5@kernel.org> References: <20240822-arm64-gcs-v11-0-41b81947ecb5@kernel.org> In-Reply-To: <20240822-arm64-gcs-v11-0-41b81947ecb5@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 , Yury Khrustalev , Wilco Dijkstra , 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=sM6ARMSzs2g0dbHkgGbbEwKAjUQqEhC4Xbb3feAOKmM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmxpEwGtjAb+Lbq6W5IxNjQfUxybDiSmB4j0xd4UwH +MPuN7mJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZsaRMAAKCRAk1otyXVSH0OdpCA CEOwzdvcro2Y/zsVAkDS1Gh8cqiwIlyIDREbBn+Y1Fsz928BKFuNCbEKy7zALRTxwtRrlYxNM9ZJl8 v6kBCKRDXGCRs98LRzPScxPU+FhtqEHbzd58yzE/ITWCObVM3dIfqSk1nd5rqSljitoRrI5Kx1XQYV reoDx/QxEVXfbj+YAbA297F3QOBTCghWQDCw4v4wkEH9Z7B/dOGjQVjJmxl9Wejbw9+9iT0x0PJDnN SwIXivwFaJ7YaXO7TSqvUYuVOOn7lmltxhmeimqnTp36IqnALj79krb8UmEeBQbeBn5DHxK5DgJzy6 WY4Wviz9IEqS1ZQnNP7EKG/eX+Mm1s X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0A89614001B X-Stat-Signature: g9szj4uxibncqpix5p6rmxbd7jaqir8n X-Rspam-User: X-HE-Tag: 1724289562-952835 X-HE-Meta: U2FsdGVkX18h1YUemY6KKTgQJHbci5kjHRrL3B6Ulv/KRU/UAvpGvDFCQUWzUPgY9wJQpGivwZFroFxcOCHLY1gfWXOw4pFUUw23FfnD8sCRo3A0JIXj/YTkFxVEI0n9mYXKVZj4BA7A5xKOmk4yf4PtJipGwR9/cqiJBVokWHBGl0/3hkKrx/IqHs2PevlI6zVFioQ/RrBggrBQUS+c7yQA4XVX4FcC70ONoiNuv7nCOuXo9ne+/wOBLvL2uG0EDY+k8xwQaQsOJwn4JcS98QriPRpg2f66KBRh1RwjbBhYSJqxxPfN/5bEAKWIEBCIMkR/dJlh1WUfTgzvxlfHIBYWcA1LtjDSmznzB0zEhxuK95OFh5iw/ThqD52zGF55ZSvf0MYUXLR6GPbIetORixhdG70r8iKE70Wha6ZqOMKx5f5ORfZ6gLODRI8Zsmc616evIvu/cBChIXdb6pcfhxtokuJTqDBljyy5eyR5kK6I3xA6SEYrE7gNPIcS6IHus3ACq/sFpXCsR5YcMhdwD9U1ek+WIuspk9E5OSqVETcO1dIMvqMEg4iSXM6ht/b2guLLX1LXdfl7b7hJjQp+pUHdILhyetEYph0WCA61wpSPkWDTa3y+pOtYNY2wD7Cd1Z6WYEknEqssBfSeDy5aRZMq7IQ397E7dAUBFuO/AsCRXy/Ttaeo8YaKhrGxe+8LKBZc6NoFmn4UlCgIWRdqVq5k2rZqErI38Yi4+pbnTLCrkM56W2mbHwV8ixDRtzs57qvRt1Ifh9WbnZyY7R8ySGr0gQUBrdaaqQM7DISKCMeF9Y8WzMz1JtmDWtMvYguy7uxoy0j/WsJtOvpLNWWCsP/Xpd1abKfusWJruglmtrQHASBqH5fkdY4kcBQ09zU2j1VjkAsCbs33FN/9uV1vFvQNY4MTkTC1K+iHWMtHhjnXaKr4FWCsNOVLv8x3ns/K0V8dGfzQ8LOqPoPEKTt G9Z5iKz9 /EWgR87pZ2kdmluDqbSo7utCbOOJkWn3aTMhF5rRizW9JcH2Z6jvuqw7fVd8uRLF53KgF8tEmOuyoWFdrvSnMvUdysmCScgwwcOeBSJEiO7Snhps20QjOeGJvPa87oMvXQiWalXbWrPrCm+rT10+V+m23dEBp3Ssj113K94xVcrJZcmQE7Yr8lKePYgIvX3L1Z1N8RsGIQoS/Sq302tKFOgMAxq4LUvF4so4XLsEhXXxxKaslIigUO54AKXsiy7WoeIsqWSzr8FmD1LJgV0LllnFDBC+FruvXjeFusaGGf5UHRo+3lrhWXmma5obGUUTaqATozjppi5E17HNYoZfWVi+RgvXRUuSnWn043T4FWXDSGO3Y/qY+muWZC5+jb0LcLX0P 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 Reviewed-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 09126bb8cc9f..e6413bb8e6e1 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 "