From patchwork Mon Oct 9 12:08:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13413517 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 484A3E95A97 for ; Mon, 9 Oct 2023 12:12:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D51126B0118; Mon, 9 Oct 2023 08:12:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D03476B0119; Mon, 9 Oct 2023 08:12:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF0146B011A; Mon, 9 Oct 2023 08:12:36 -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 AFE516B0118 for ; Mon, 9 Oct 2023 08:12:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 87A424023A for ; Mon, 9 Oct 2023 12:12:36 +0000 (UTC) X-FDA: 81325811112.13.5C8DF77 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf05.hostedemail.com (Postfix) with ESMTP id 7D7F0100006 for ; Mon, 9 Oct 2023 12:12:34 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sQev2RNt; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of broonie@kernel.org designates 145.40.68.75 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=1696853554; 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=zwxRBQqN/sYfjycdFrNYqttjbdgy8h6Z6Lt0sqArAlA=; b=qioYL5RyKSaenaHgX5n52J64LLpI+kKxsI6svLF3voCQ12tpLqsw4YvfFWnmBOh+B6m/dE cwnbuJoMzY1Xn+DvjiQieNIkAhnYzePO0s6c9rEl43UdlYBGq60HNJiWVrPvnV4YjySukY pN5iFyQOwuUUXClBw5itDF1v3Kko/7w= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sQev2RNt; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of broonie@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696853554; a=rsa-sha256; cv=none; b=m2eyCg4eJoNxSh8kfwm9W3Xic8JvMs/VWgdNf1RIqk5z+8TbS2nUUg9x2fQm0/e1GbUCkS Q4Jco1GVQWjKg2D3pjzbibaVlvR52EXtTOH9a/iPaYByScAB19Gq0mEiKLb1RMsPUi7tYs CLbW+Q31HL0rqbzgS+22BangVswYMLM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 0B64FB81151; Mon, 9 Oct 2023 12:12:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 694ADC433CD; Mon, 9 Oct 2023 12:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696853552; bh=/vPx3SSl+mfIKMquypHtEKuBIXlpLAB4iLa0L5RlD3w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sQev2RNtEnDEFPBmWkg1aPYHogLgGleP2M9edpa6zdfjrOm77CPrvQi8niVT3Q3XA PmofI6bdrOe3jo465oZ65rqQozZTbERNjr1JlgHm9YKvcfsq3nEWGOY27pZmgfjjyY dDSMy7U4xKkDc8C60A7VbrEkW/LnelkzXfGdxcDiA0l3rymIJ+ckAVoGbH5xXkvHEN 6zP+9swYon2IccqrGEKpcXv0rcTceZlfZ3HMAZiaAMgZ4Bk4wkuyPEIExSAnXIRc6s zhy1goGSBeOKhYpRqjCoLzuKbooaSsK4gY62IJDkYR2h8CzvSzLQp21Fv5NqJLcB65 0bMJuO/3HSw5A== From: Mark Brown Date: Mon, 09 Oct 2023 13:08:50 +0100 Subject: [PATCH v6 16/38] arm64/idreg: Add overrride for GCS MIME-Version: 1.0 Message-Id: <20231009-arm64-gcs-v6-16-78e55deaa4dd@kernel.org> References: <20231009-arm64-gcs-v6-0-78e55deaa4dd@kernel.org> In-Reply-To: <20231009-arm64-gcs-v6-0-78e55deaa4dd@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 , Florian Weimer , Christian Brauner , 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-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=1992; i=broonie@kernel.org; h=from:subject:message-id; bh=/vPx3SSl+mfIKMquypHtEKuBIXlpLAB4iLa0L5RlD3w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlI+2drxB++QScfidUv9L+xi632YD4JcSnKHzTsqVd VSQXvKOJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZSPtnQAKCRAk1otyXVSH0A4PB/ 4ipjQMsBwdu2UD/vynqchKToRd0kqycl2G6DpsLfpWzFXRwRKSxafYc9AJV0lZ6KMxJHds43jisMvV JanLIXBScLRN2udzGEqwJxIOrJBqqd44dzshYankAdncw0JSQY6G4yAhGSytSv9bNgOzDeKTlAsmV6 6NkSgFh0Oi4iEOc2ROpLbOMk7/0IfTWjwEtrFMc+CFnQjvhR6BQ7Z/NuarIeE9cTd/KsjjJsHf/vvu yE89uLbLzKRtn5yyZsZKUQGm7gFXI37sKp5lcnx8lZe81PNtoBftCEicoN9GK9nWuDtwQgrd9k8tLi qhX2miMaBp7oy6sv9dTtWraYtOdYPx X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 7D7F0100006 X-Stat-Signature: 5iwq5e6d5rjgpnqbxkbwngwk5j4u4s6o X-Rspam-User: X-HE-Tag: 1696853554-359235 X-HE-Meta: U2FsdGVkX1+Lsm8XNbImJPs7mZT55tMiuBdR7mAPUjgVmGVrXLAJa7gjWy5pvVVa7xOMP75NE2f2xTm+J4yV0SAOzEQHt7XaXgj5xNJ208p/c//6NUhhQFGi5AkmY52OQjv4jhDKElpTkzak8ZZbW2Q4ougtUOy4eKHNf2xjKLH8xFufa+FNILQVbMrSzaeA12z3nzyMAxOx2N7tzFo8BdPf5js8x5uDnObd9gvdfG4oXeDpnMCu1fRODhuztaHBr7uZh5PuxF23MVcuxo4uAZ5/2kxWzV3qc5wm75GK/1FJnSINICTkuLRKr725+E5o9+4ZctWE6tvuPsLxEvG8ZwRoHIUf0HzkvQ3DUg8SafS+5mcTnAurJJDLTtXYHM8vouRNmDFMTNoSxkvB/6N7lxc8dlk1zQdn6SgVvl5VZbmVv4XbPGN8eMHUCY3hFjurOihSVrzR0IItOsL4NRrqHshpXlmB2lU6NvtlYqpBumzwpz+dnayrMV7lePlIGykoKI4CnuzBgFcOGIPzCPaXYRN+XWXiKN0Z7VMVOiuv6EokyU161/RmQyncu5UCY0cUZKdifItNRYlR9ZYBTRJ3Eg8AQHRAd0t5pF18NJmVwldE9Gl8wPiaByqE4iQe7DtfTU0TEuQBJ+XEaZSoW1e5Rko3LUn0gZWaPoJ18bEmBSSDjFiGjfkzLp+SwS4ttKAyOBgZzCp/9Nvp5oqXPU4rsahwHtD5nOjZlGWKZsTllQ2qO/bqW4VBjrDAxEk3UPnULgW0iV0RA/UD3wLWQ/oyPzgtERHDSAQsfeeWstoSTf9ysYub4sjC7m7clgQPyXvslQ6V3w0Y0x1G4rVK4qkIZysTQZ/EaryGLlvX3tPZs0HhgzSAoivZktyfE+sRTiwOx1YtTKhfd05dXBZKa5i4y7CH28+KDHjGU+aY8qzVLEVkfP4hND/uIqm4T9ZXYUINarXNZfasfWnBFDgEkHZ Q3rF1HDm bag1edc4/7PcYsTFjLj+MIdw/h40C757dY2kjtlIJwaVmQYgT4Vn1H1J/QhS3Z33XXLbQpLLY9AUASDKgkxj/tgxjtc8f6Fs4zag5uUrn3ZHNXgaF62RDF+eO7TFS7R4QVRSca5M9Vv/AHSqTFKDQ1nX7cMly6t1JCqmWIVW/V0WSDftr78tzJBNuIg0uRoLr/G8wjtRb1cvf4kwB+083YZoyGXFGdp3mkPhWxecTX+y8skv6sMrKihYIMAKk1slrjZHAEIbks0qQ0OI9l6kK7j+lCnWv0ehyY4cUtHvJ6ZNWxXex+ce05HoxhenMWfOEb8yINXHqMDHgIHo= 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: Hook up an override for GCS, allowing it to be disabled from the command line by specifying arm64.nogcs in case there are problems. Signed-off-by: Mark Brown --- Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ arch/arm64/kernel/idreg-override.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 0a1731a0f0ef..7afea5f41ce0 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -418,9 +418,15 @@ 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 + arm64.nopauth [ARM64] Unconditionally disable Pointer Authentication + support + arm64.nomte [ARM64] Unconditionally disable Memory Tagging Extension support diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 3addc09f8746..cc059ba39d58 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -99,6 +99,7 @@ static const struct ftr_set_desc pfr1 __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), {} @@ -178,6 +179,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 "