From patchwork Tue Oct 27 21:51:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 11861955 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 00D26C388F9 for ; Tue, 27 Oct 2020 21:52:35 +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 8E0F820756 for ; Tue, 27 Oct 2020 21:52:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qn3oN9s/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="cYFhzVnj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E0F820756 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=UxeMEps3WZtQFst6Kycbg39WN31TuV7DKJPRQu23MYI=; b=qn3oN9s/5cqflbYerE8M9Osl8 nBhPTNoBUSAsDzBsSvgO3kOxsviRjwAUjt2JWbaxFdD9Na3PR1IsUUDAoEiSbqPfn3az9wez/ateS 8Megikbytj14lUyN7IKeGe464qV1nP6EYjsu3vKJbWcogj4KdFO6qKx36JBo73BG42YK9OdqfXuN7 Y9cVgLvWlvMrEb+paQi1MXilTGiEXXwWssFvIoeWNse1gGdE+x4ub6Y3wcXInRJ1D4yCfeYvmlXFU E6SHsoYB1BpNuwp3j2C76YVK/C5TzJnu4qNK2/BSuQwKKnWlJWD0KVqhQ0gqVyoRCgyvlrB/KCNNg PaYYCuhkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXWsv-0002Wg-7A; Tue, 27 Oct 2020 21:52:05 +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 1kXWsV-0002QE-GM for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 21:51:41 +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 C464E22249; Tue, 27 Oct 2020 21:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603835498; bh=Ka4lRA9eCqvV0mOQOAKOwdP3JXDO0/rJj+vKpZ1rCUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cYFhzVnjg1EqcT7oLaMbsjThTi5jopeWooHM/SUSykJR7E/YAYGHKyk+lfPzBCkxB cCP/K9H5xhPonZa32Z4HOPjfWmCtNOoqaT7tLkkUsUF0WYUWjxPu+8RXw68R4JepEW Jd5kaSBSGx0jz4Sp7CbGuy99h2b4hktL2xGYDmXA= From: Will Deacon To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/6] arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 Date: Tue, 27 Oct 2020 21:51:18 +0000 Message-Id: <20201027215118.27003-7-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027215118.27003-1-will@kernel.org> References: <20201027215118.27003-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_175139_710656_B651D0F4 X-CRM114-Status: GOOD ( 13.94 ) 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, 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..1d9021db4d9f 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 not all 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 9f29d4d1ef7e..ccc08da443ec 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1237,6 +1237,13 @@ bool system_has_mismatched_32bit_el0(void) return fld == ID_AA64PFR0_EL0_64BIT_ONLY; } +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 kobject *kobj, struct kobj_attribute *attr, char *buf) {