From patchwork Mon Apr 29 10:28:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea della Porta X-Patchwork-Id: 13646577 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0394C4345F for ; Mon, 29 Apr 2024 10:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=QfzXRi8RtnSGi0X4qTM1KSwdurMlFqG2B7Z+LX+3AZY=; b=zMjxgrQCGHDNkV sQe0M5kNzOQozeHe9flX0Vm/K1kSC3BJMn3WX4+fsvmjnvBVHNXzRg5NwUrC0uYyccvkqNxwLsrdS pc2suNyrVUL32dbGfaJY/BUyHRV+8r5FLsTXItM1ClOeLXlGzTBS7ABqn9qvZOko9trDiFwPwe7DS oUrIac7LQK+ESbpISjVq2GlbVy5W8lQ7z/JGOzDBNbFyxjw6XllnPixzBHLfUQll4nfN/+L0iJktz NeMsmp91VMizw7ieB4YsA2SoYjgeFGq3Wfhi9qGI55Rzbi8h7JrSU5fizxNNRGLEz+G+9sgikDxlp 80+IKpk7JFABQ5kINCdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1OFR-00000002H5q-2JCp; Mon, 29 Apr 2024 10:28:37 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1OFO-00000002H4l-3mwy for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 10:28:36 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-57225322312so5694103a12.1 for ; Mon, 29 Apr 2024 03:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1714386512; x=1714991312; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FqIqBz6Y02C/839EpmWphKSVTMKni6vPtbW42hvmKzg=; b=BCV9hXQRjVorZ+B0AW8YQN7Y4WhNeIcuUHS8Gmzws31NnHUl+rHxlrYQriJHM2TbxT DGYR5oPhVl1YJCUQ0/FarAoNfnmPgnOEmJsA5GRd6uzB//rDX6hgWyjM1vboyxz8pAWp tPqYs6HLmKqkrVghv8Z7yiandJbzp0ZUdX5Ppqatuyp+a+VNA4QzqvCAJBxPMvI6ZkUp Z1VKJE0Dcncb+kxahSpvKUP6j7E2GJjqK3TPBfo8BFBumUExE2qBwcMdtktjJSGyW8Md NuzoVVMM8FzTSKxdhZRs+x31pmoBZh/HPf11sYqfjXAxMaQzeQ1F52KbfVjsrcR5cOUQ OcBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714386512; x=1714991312; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FqIqBz6Y02C/839EpmWphKSVTMKni6vPtbW42hvmKzg=; b=qd86Tcs4DLXGSJNZgtRPMnr1XWtXeNxsiUR+ff6mZkGXoJk4dd1/c5li1Bd6UBqgwA NvQqxDx24WaFKeekr81wdBL5V4nzF35jH9utpuVs1ZqR84xUcXLFQEd7fUleLWM2jKxC F5MsXPmAEnbM1i7Iw/3WJtMyjmjcPFQ+z0sYGyJDf0Y2gco2An0oeXF4ZjBt1zdENKNU /5yl/p1jLeveQVl0/Rxl8h4wkhyJOMNBTg6E3mFSSrVxFakcXLnO0hIGBvT+U4VhvdXE kH/zrK/fP4KjCyta++GtyzP3RvheCNPNEbeDvNct/Qd7O6D9eaZ1Ok8/pjSS2it1RsEz g9Lw== X-Forwarded-Encrypted: i=1; AJvYcCUMV7S8wiGwnMXrIFVkIEl+vR+Ormf6ifLEMOwhjUxSiE62iB71mqx/pxbVGSnBouzatP533vnke0zZkfUwDo6jIEdIrv7W4YCapJcukTOuet+Dwlc= X-Gm-Message-State: AOJu0Yz810Y7gFxYbjxjFB9Y2fTXe/ZQmqLwnDn6yuDwPNJCDrbxUeCL vpXlGCwge9g/nehPl9CK65NtG02w3HCaUD0LxvIgGZ/IlkHKuVuDGbST4yMv0WQlmypW3YxLzy5 J X-Google-Smtp-Source: AGHT+IGk7poBJDqxBC8RIuhWEuhiH8SNVgCaNVYIu7mFxCZ/jUnMw1jEU82V7gWgsKAPZAtmNfZW0A== X-Received: by 2002:a50:c344:0:b0:572:8b30:bef7 with SMTP id q4-20020a50c344000000b005728b30bef7mr118088edb.2.1714386511758; Mon, 29 Apr 2024 03:28:31 -0700 (PDT) Received: from localhost (host-87-1-234-99.retail.telecomitalia.it. [87.1.234.99]) by smtp.gmail.com with ESMTPSA id x7-20020aa7cd87000000b0057270606829sm2283249edv.85.2024.04.29.03.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:28:31 -0700 (PDT) From: Andrea della Porta To: Jonathan Corbet , Catalin Marinas , Will Deacon , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Andrea della Porta Subject: [PATCH v3] arm64: Add the arm64.no32bit_el0 command line option Date: Mon, 29 Apr 2024 12:28:33 +0200 Message-ID: <20240429102833.6426-1-andrea.porta@suse.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_032834_977372_E2C3C140 X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Introducing the field 'el0' to the idreg-override for register ID_AA64PFR0_EL1. This field is also aliased to the new kernel command line option 'arm64.no32bit_el0' as a more recognizable and mnemonic name to disable the execution of 32 bit userspace applications (i.e. avoid Aarch32 execution state in EL0) from kernel command line. Changes in V3: - idreg-override.c has been moved to arch/arm64/kernel/pi/ directory, so this patch revision adjust for that change. Link: https://lore.kernel.org/all/20240207105847.7739-1-andrea.porta@suse.com/ Signed-off-by: Andrea della Porta --- 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 bb884c14b2f6..3e70963599df 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -431,6 +431,9 @@ arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards Format: ,, + arm64.no32bit_el0 [ARM64] Unconditionally disable the execution of + 32 bit applications. + arm64.nobti [ARM64] Unconditionally disable Branch Target Identification support diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c index aad399796e81..48c1aa456af9 100644 --- a/arch/arm64/kernel/pi/idreg-override.c +++ b/arch/arm64/kernel/pi/idreg-override.c @@ -108,6 +108,7 @@ static const struct ftr_set_desc pfr0 __prel64_initconst = { .override = &id_aa64pfr0_override, .fields = { FIELD("sve", ID_AA64PFR0_EL1_SVE_SHIFT, pfr0_sve_filter), + FIELD("el0", ID_AA64PFR0_EL1_EL0_SHIFT, NULL), {} }, }; @@ -223,6 +224,7 @@ static const struct { { "nokaslr", "arm64_sw.nokaslr=1" }, { "rodata=off", "arm64_sw.rodataoff=1" }, { "arm64.nolva", "id_aa64mmfr2.varange=0" }, + { "arm64.no32bit_el0", "id_aa64pfr0.el0=1" }, }; static int __init parse_hexdigit(const char *p, u64 *v)