From patchwork Tue Aug 22 13:56:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13360865 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 8FB4BEE49A3 for ; Tue, 22 Aug 2023 14:04:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E63D028001E; Tue, 22 Aug 2023 10:04:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3B3528001C; Tue, 22 Aug 2023 10:04:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C66AC28001E; Tue, 22 Aug 2023 10:04:39 -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 B7AE828001C for ; Tue, 22 Aug 2023 10:04:39 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7BBFE8037B for ; Tue, 22 Aug 2023 14:04:39 +0000 (UTC) X-FDA: 81151911078.26.95351F9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id A270B140029 for ; Tue, 22 Aug 2023 14:04:37 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YYudIVDK; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.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=1692713077; 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=iadIWJuHN8AZp4shJqs/Z4ZMaN950AHuxo2IE9WbDio=; b=Y6kf6zJ9bxE8PRMTg6Vyfgfky7qLyRfj+Pv6knXkMhBmVgZhikoQ036k2EEg1DNft8LeTe K422YdO6Y6VofRpKQiiX23i4L1sCy2ZQY+w2p+I6hil1qYzgmdaG3nTHN7EqXHn3ENfGwJ rT65XNGNGv90e+L6GytpwjFbcuEynVU= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YYudIVDK; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.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=1692713077; a=rsa-sha256; cv=none; b=Q8Dt0fO0J7gSVQcVHgSsme9UNfeto/d6EOoHux7es1XJq3II7VQe42wXLUudMBM9NIkn4g YwURB9eVumVkrn4LTTJMgqG+wzMxY/jlThhoZXgfbXA3d9z+ytr2ApEfMEwLUFXe3UpW7/ A25WnncfuEgoZ7Bhxvmk+uMNK+aFEXo= 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 DF91E6578D; Tue, 22 Aug 2023 14:04:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 637FEC433C8; Tue, 22 Aug 2023 14:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692713076; bh=BjSs+8ue7c1H5I5QACEoP8ql+D11AcMui7dws1SE6+0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YYudIVDKeZ64ux9gS+b7EEI0CFilzLHr333iJGwzf5IaJ38241Xo35cybJ+qZjFjm DlAYEs+0lW0wpovAkKGvxfGleavVcNMPfOE5fo9twLauPP1tMoChERD1Dj0VvhXoPC 97VEDpPfpJdiezZTvQcProtNPd0MVIUwWfjMl4tB73egWWMrRrdMwK4vKBSdIhV0na PCOsq/Op8XvQCGTOkGokgmggGAZoYZIPBgOmmsxxadVz5PeqfDrHx7T/pPGtpumilu YwWS3Bt9cPpKMESV9UQ3/O7Xaocvnskv8Cgaihid40D31wcvbccM7QccSVb1zaKVZV dQbS/QgpFL9nQ== From: Mark Brown Date: Tue, 22 Aug 2023 14:56:48 +0100 Subject: [PATCH v5 15/37] arm64/idreg: Add overrride for GCS MIME-Version: 1.0 Message-Id: <20230822-arm64-gcs-v5-15-9ef181dd6324@kernel.org> References: <20230822-arm64-gcs-v5-0-9ef181dd6324@kernel.org> In-Reply-To: <20230822-arm64-gcs-v5-0-9ef181dd6324@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=1796; i=broonie@kernel.org; h=from:subject:message-id; bh=BjSs+8ue7c1H5I5QACEoP8ql+D11AcMui7dws1SE6+0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBk5L/73XL0iokCImrRKXP/21OSX2L2yPVV1v7s2wY4 g9W2E3KJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZOS/+wAKCRAk1otyXVSH0Hp7B/ 9TkwiS9meL95VJAznp1nMQ/n3JUjWWplN4cMGVGurbd2xN6W5i3yXQ2z33BoOw2HFrxGoOLrmPJNwT HTj2aLJnz3/Kyg39s0aFy7cT/FwU0da8kxB77nLYzpi4q2L2QW4BkJdXEsKSi07uMYtZZ6cZYaj3Wg LFNjybT88/1wTRBZYuGs0JH1OnfRXymn66wAH6OImjngP+/0KyBb+20nPBx7HG0Qu7H+qsbgMbeB/X u22V4HhEIldSaxkWwHawv5dul8qD5MtJcUqPfHc0GOMY5BpC2cXzUqPHqOXn8Sf6ZjKcmA5vU/V4VM GNzGhRiVXq8AU5aMh47ulF+OnkwWAn X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Queue-Id: A270B140029 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 6apmr4hjqe4jck3zmyrk8ibky9itcgk9 X-HE-Tag: 1692713077-204111 X-HE-Meta: U2FsdGVkX19dzdDGj1TylgSYYnxHHu+0vt6z4i8+V6+ZT4ISZaIgG48c3BckX0T7Nh0O+Auih6YD90hG6yfhUeiPoVORjMoEmrE2MGcsrGm/Bau37rJuzZOpYUWHs8Bwc7ZEnYQrLq+sJPyk5L3uDKtB/oLMqQiwGbHE/J69THnd7DBvHxCRttUdrYhE3nvA9oRnSva8cN31rOAbzsNdfMfl1LQcesaI+OoHVeK3ZJS53KBWOuYoVntEbFdE60vxLWIqeZ7DJ5RSf366+64NrBJFVVWSdAvDbK+VOf9hmAPns7e3UslZg950l/fISdpohlFCfaz3/TT6Os/x0/JMUIk1OXgTEL8XvsW0ygrZkzKH75hPPzH9pH4/E+CsF0qcO6BmT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m@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 | 3 +++ arch/arm64/kernel/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 722b6eca2e93..db58fc2133fb 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -418,6 +418,9 @@ arm64.nobti [ARM64] Unconditionally disable Branch Target Identification support + arm64.nogcs [ARM64] Unconditionally disable Guarded Control Stack + support + arm64.nopauth [ARM64] Unconditionally disable Pointer Authentication support diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 2fe2491b692c..49269a5cff10 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 "