From patchwork Mon Nov 9 21:30:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 11892607 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71D5AC5517A for ; Mon, 9 Nov 2020 21:31:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED852206CB for ; Mon, 9 Nov 2020 21:31:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PYh5ba7f"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ovDfpcbD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED852206CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cSLrGaA2RHuL2/cNSAubPMHidrpX+F4p6TJeYEC5y1M=; b=PYh5ba7ftfi+cBDLBQIcUFZyg B3hWdcKeMDUrqPNI+x7gg4YpfHmZ8zbx2UhEHvzQp4k8EsgE3iStjrF/Y9qlhlx1BYZv3kRV5Noph bq/ATEScKu52nLvLHw9lZg9BO8m9bzw+dy9yfOid74Yt/hRqSGokDrWv6kzCeW2N6OEjyoa5/48Qt T9Lt5Hdirp8mT37lY0x2QEbzAcuSv1sJFmTEl70HsmPtJb7ldQOZ4YSJZ3c3EcQM6gENMD8jljQuA odvT9oNdq3tteURWxnjeqaiz95cO6HzIh48hl4aAMq2W+aGBk1lel//u3gAP8uOjzmm4eplrg3llR lV9BIojmA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcEkl-00019N-Rt; Mon, 09 Nov 2020 21:31:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcEkV-000144-CX for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2020 21:30:52 +0000 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F64A20789; Mon, 9 Nov 2020 21:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604957450; bh=HSjNPPCbNtKAMQvJq+6iKlzbrxmh78a3ebLtKvorRqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ovDfpcbD4U3KciOkO+oSvqxLFN+b8g53+gTKGYFAJDwIfx3KpSaxmoK1VgWW9gFub WPO7lYPc+W1H8JAHwSqmC1wKHMfZftd6CXPpcW6fWiB0KYhEHllAb4NxujvHmiR2sk 3G1g72b1+Ql7ZgRTr3B3CwMGjjBBYvYE8tMtgNcI= From: Will Deacon To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 6/6] arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 Date: Mon, 9 Nov 2020 21:30:22 +0000 Message-Id: <20201109213023.15092-7-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201109213023.15092-1-will@kernel.org> References: <20201109213023.15092-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_163051_596283_95C6BCAC X-CRM114-Status: GOOD ( 15.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Marc Zyngier , kernel-team@android.com, Quentin Perret , Peter Zijlstra , Catalin Marinas , Qais Yousef , Suren Baghdasaryan , Greg Kroah-Hartman , Will Deacon , Morten Rasmussen Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow systems with mismatched 32-bit support at EL0 to run 32-bit applications based on a new kernel parameter. Signed-off-by: Will Deacon --- Documentation/admin-guide/kernel-parameters.txt | 7 +++++++ arch/arm64/kernel/cpufeature.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 526d65d8573a..f20188c44d83 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -289,6 +289,13 @@ do not want to use tracing_snapshot_alloc() as it needs to be done where GFP_KERNEL allocations are allowed. + allow_mismatched_32bit_el0 [ARM64] + Allow execve() of 32-bit applications and setting of the + PER_LINUX32 personality on systems where only a strict + subset of the CPUs support 32-bit EL0. When this + parameter is present, the set of CPUs supporting 32-bit + EL0 is indicated by /sys/devices/system/cpu/aarch32_el0. + amd_iommu= [HW,X86-64] Pass parameters to the AMD IOMMU driver in the system. Possible values are: diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c90f4a18768c..cd106267408a 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1270,6 +1270,13 @@ const struct cpumask *system_32bit_el0_cpumask(void) return cpu_present_mask; } +static int __init parse_32bit_el0_param(char *str) +{ + allow_mismatched_32bit_el0 = true; + return 0; +} +early_param("allow_mismatched_32bit_el0", parse_32bit_el0_param); + static ssize_t aarch32_el0_show(struct device *dev, struct device_attribute *attr, char *buf) {