From patchwork Tue Jun 25 14:57:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13711443 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 E9455C2BBCA for ; Tue, 25 Jun 2024 15:02:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77D236B00AD; Tue, 25 Jun 2024 11:02:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72C716B00AF; Tue, 25 Jun 2024 11:02:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A78C6B00B0; Tue, 25 Jun 2024 11:02:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 381506B00AD for ; Tue, 25 Jun 2024 11:02:59 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 626E21C08C4 for ; Tue, 25 Jun 2024 15:02:58 +0000 (UTC) X-FDA: 82269728436.02.C91460D Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf12.hostedemail.com (Postfix) with ESMTP id 3E11C4010E for ; Tue, 25 Jun 2024 15:02:29 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=T1tf4EPZ; spf=pass (imf12.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719327743; a=rsa-sha256; cv=none; b=lQNb4O/ODgiEOsA7lJT7776bVdLYYJqAmwug9b4HmQsjyY451hsn3aT5ffj02mOHztDQDw DzfeZ6NCxmwWjm+LCfG0W0b+ZLUkN5XeKpleYPTQ9xW7npVhfegsWPw2VHsf3s5D+ZTS3T w7WmgmtA/Oejn7xc4DwklOqNMVGDYhs= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=T1tf4EPZ; spf=pass (imf12.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719327743; 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=M4ul9MBwWnIIsGgh5VTJpSGeQwgaTZfhbeMOXSkuJd4=; b=acNojqRPptAR+4uHyBdS5fmcFU8jIK3iy03UghyQRYn91Dof2jvHjSbLGu2dy2kOrZipOy h7RaguwoogxT5mDc1FZ0pax+yDjwe7GyY3Fe/Nb9WPI7IF5kcxz5yhr9u7q74NCDhJbgC8 OpDYyQ1WlCRux5K+9CsERbLDwf3Dwck= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6EB0ACE1B7F; Tue, 25 Jun 2024 15:02:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C4C9C32781; Tue, 25 Jun 2024 15:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719327746; bh=TArF8eu7bR+kdEQcw0PtiH938ElhCp6XbYhZJoxTCrM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=T1tf4EPZxQepBQJZ+2P0ysocX15TlkKsctCglrLlJlpjTmopmLVcDgRZfo2fIdmZD Lv/NFHftNTdwBf3DqfZoSYfV6WuoyPIQEs2TNGXOriUMN11am9Hf5vq5ldwCQf9dmn 0E6qSnfvlSNhImxN7J/5Esjy55MKMRoTeQxGdu/7rc+s6RaBqycPQCbJ1TvVIWnutd b0q5gHzn3xZPm6Kw8+HEdwKQCSqhFutpjECRBpgQ1baiTggkrS2AIXDeYXF3KKOsEf YDaxMulmfJyDO7V7EcDfLhjZVhoJxdoOD6NAE0/79RPpuNfB41K0JcAzwYXIXZ95se U9cnQ8VrLX3Iw== From: Mark Brown Date: Tue, 25 Jun 2024 15:57:43 +0100 Subject: [PATCH v9 15/39] arm64/idreg: Add overrride for GCS MIME-Version: 1.0 Message-Id: <20240625-arm64-gcs-v9-15-0f634469b8f0@kernel.org> References: <20240625-arm64-gcs-v9-0-0f634469b8f0@kernel.org> In-Reply-To: <20240625-arm64-gcs-v9-0-0f634469b8f0@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.14-dev-d4707 X-Developer-Signature: v=1; a=openpgp-sha256; l=2079; i=broonie@kernel.org; h=from:subject:message-id; bh=TArF8eu7bR+kdEQcw0PtiH938ElhCp6XbYhZJoxTCrM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmett9kBlIGznTOvZYNu30sR1HSi39oURagt2PuqvD Y/xML0+JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZnrbfQAKCRAk1otyXVSH0KppB/ 9h/NsU5ZbvEakpJLVgdEkxvY5UpqOW1ugkUmSI7i1GKJvwyAjnAS2GjipTcPYY971hQbCdfHwZcLlW cGE4g62zQz3KJInv2E7a5LvVkEoEx9xQoaz4HTnvgXRkvw7mt57wnleIJzA434vuYSF783mIrrb/33 UM4KkpS3btWvRrCRi2VY8VDuFhRhvl/BAYFalo/nvTDQt/Bivon71MD9KXQCaREWjPFWn45DqF5xqc fgB9TM3IcC9LyqQXwPr+ng36ckx4ht13tLxNrKJmclwsKt2v/DvuX9vgsKXW5FMhSnNTPvaVjaVXuC UWd9Pvf2d8i4vTpWJR3H1tCTBLdgiV X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Stat-Signature: 5swrfjzhf9mro8g93yxrz38fkuhzfuqy X-Rspamd-Queue-Id: 3E11C4010E X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719327749-383926 X-HE-Meta: U2FsdGVkX19eCL1Uvkyh0JVec18WGnORmCku3Vsyt/cPOEmxicsN965ZR6vmjf5ED57yy7Y1ehBsDPkk2adMQE5xGnpfSpgyZVPnbyMh00ESRj2Ug7IpKx/G9X6DjT2DTHEn2fDkgAaIQG9EZ2IExb5yC3RSLbzMVF1RfZkv/wROzYjEaPaTDlOFKnoWOyIVcsqjAWA785xlm41LxcQ0KuBjfAdjL5khTMmQQOlupUP5nv8+P80gDzDROmrNSKhSu1Ao4FBtardMz6jEmRhLCcjy5tJ+uXZmoSOnO7c3yL+Zv1349dk/O8TzKVcmIyS0RU98HzOyNqYeXhOX3lWJUH/AXmE8OjUOBRrVUR01BmhUV7xUL1ZdrhWGT+Wgr0fNMPJwbetnTdtxMM7Maw7lbd1LeUaEaogZI75roihajd5TDVZsVaWwnxBuYdXijWFppqFx1HphbT6Y3bvWOaXx0qUVzp5zp2cBArHC5xzF7D4zizTblhpdpVPEtuskJe+YRK86Nndp6lb7rtx7aTF/+uj4hnjA7/6tgTqcEC/RDa6WpKzGchAlSDnf0eKLJhZ7HA4xqxuPaESBoafJZSmqqmu8pnBOVzfKzKCaglxyQPU8kdlesJTFWQPDtqyVDKd8i1hweKu9B6M0CI3LwKi4razADzThhfHi732mezCBX2y37YSY6oZq+4JSRHJ9UFLkiSVHPDe1WREWjQLiv9geCBvSTGKdqrZw5cmqNmrx7Z/tAxmE4ZwEasCcWbUboRJ/hf3Q+Oh57PBM1X3X9SKfZvdb3MjXrQCtY+UUhpCcRvwKSCMApWdAtl3NFEY+qQZ2u+h2zZ26UKGoSB6VUT1DuVB5iHOgN9QjKHN0K6F7YzE9sPdFDcEYQwnrTplR8WRLoVmUJJpC3rahiMcWuawY8wCKT7OzZXFowD3hazzi8vPQ/nZaiDEFIYSBINaPS2yPfy/z+llxFvIZsUlJUbZ feVOF6M9 uBcJ86HvIMC4B58m5cSCHSFcDYnFGbryKSyvs+y7KiuvFPorS+tq9sXX/pIpmVZ0r3S73M7FbVoyZFQqtQAtzHZKC/zig2F42GsgDTlAjlUJ11N+pWTFaBXgZnWa5gFcfi1GU2Y5MGI6N43LEpprgyChn0M0rK7tYQLdq/zUyAfghhkeoG5lm8SltgzD38Fi/6Srdqe4bxKaSf/dhJf8JyX2vcWdcsGOd1bzDaQkM9HeFh/OvStYrTR5TRr8IfrH2Q3XPklqt29fHDfsnE3QWlaxDmMo23WbZxzC7RivonErK16uF+InHHGCDTiAL5Xy6yfM6xq8AzvFbPiaQiJ/XcSA6bUSpCWzOTEV8eOmjDrP+M3cPyh72+yz+aA== 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 --- Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ arch/arm64/kernel/pi/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 b600df82669d..c1151d547b81 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -437,9 +437,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/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 "