From mboxrd@z Thu Jan 1 00:00:00 1970 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 771C8C433B4 for ; Tue, 18 May 2021 09:49:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DC2D613F2 for ; Tue, 18 May 2021 09:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348157AbhERJu7 (ORCPT ); Tue, 18 May 2021 05:50:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348045AbhERJuL (ORCPT ); Tue, 18 May 2021 05:50:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5329561403; Tue, 18 May 2021 09:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621331325; bh=s9Bz6q2x/QfoapW/bvF+kNoVHzS747ZjQm5kJMTQ8ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h7zS00zStct6l9agEnN+I9aZki2iULUfO6eXw/xDHXgUQvmUu3xE/mUjpzT3DviMR 3amO2G0va/GqityTOw3Etvhd/5exc6AAUv0WSMO3L6kaRkWICFIdgeMhZjWGK816lk lkCsAcHxy5SKh+ZfEbO0jca7RfulSvydQQfkm2u0stlKeh2bGqmYsnbogjv1+RcZnQ RYsaP+5wET5HnX/2kYsZAaix6vD1ujhvVw7FfH7F94gkZ2T2Ny9c9sjuVZUQc1BLY+ ltA+vSja2r8ubSMaD2LcQ7Af0AvqYzrpweCKQ+qccs9EZ9XBDWjPs4k7uwcrTU0CT7 /ia6iySGKWlpA== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com Subject: [PATCH v6 19/21] arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 Date: Tue, 18 May 2021 10:47:23 +0100 Message-Id: <20210518094725.7701-20-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210518094725.7701-1-will@kernel.org> References: <20210518094725.7701-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 | 8 ++++++++ arch/arm64/kernel/cpufeature.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index cb89dbdedc46..a2e453919bb6 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -287,6 +287,14 @@ 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 + and hot-unplug operations may be restricted. + 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 72efdc611b14..f2c97baa050f 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1298,6 +1298,13 @@ const struct cpumask *system_32bit_el0_cpumask(void) return cpu_possible_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) { -- 2.31.1.751.gd2f1c929bd-goog From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 AF4B6C433B4 for ; Tue, 18 May 2021 10:10:48 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 435E061185 for ; Tue, 18 May 2021 10:10:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 435E061185 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=glLvVpxgsHnVmz71hQWRRDq8yYQw3SFd1p5kc+ka9U4=; b=qbej1JPm1FGRh0Ipv2DCKGDgT 3inM21KxEj+YnsEumkLVv10xJRifQG2U7ifhOvmvLcdZ94l/beGtoxMylpYRahm08nbfTOKyoZa9O 4ag8Qlzq93+iUJEmtDjaXSrHC19TcUbwHgbklieJs8QNATyK7W13KXKQjG7ltOdn/QU+F0KTDSobA Qx0endfAUU/flJ7lh7bXBzgCy7Vhq7/i12U7bUC1e4RcMZrsHv3IEvkQMW8vhsgbh9qCvYeJc05L0 dBeNhIAiV4ZzXSB75npAPt5QA8F1jFLx/q5DlSZVexOJpoX7J/iYqc8bec9DIfkUTj9H0oZMUdlTS /9hubpI5g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liweb-000Hmp-KX; Tue, 18 May 2021 10:08:46 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liwLI-000E3k-9u for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 09:48:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=H1u3jivJEPCiVXSzPUEDO4O32WzfJt0Yji9f9bgjb4o=; b=dkQEGMjUGdNwoW53qxV4mZY+Nw NXe+WulyO3PKFUvVZlQF2m/x6a7s5Nwl3R5qsIDR5Th5kgZGkpuYnWGsiWkOpnZVC3GGTJr68aTiG prKg5/hKg8/+ra9cyuILJDomTyWhIKdV/0HTsLzd3PeH9HOqWEJI3vufgOoWSoLU4sphExYp9hRja 9pS8PTGkBX1DveT1+4b9IL6/viQcY7cJtaIgMdplQ8QQiwkA4XqMy+jvZgdbCsFw/fD3viveFNzul sLwcSNJmTgLwY6xBbXW44SkXJKonakuZDieR2aQKcpG8OzI5Vlavs4Bm1a3wjqpUZvV4BoFR4gBdE 2jpPDgDg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liwLF-00EWny-NF for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 09:48:46 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5329561403; Tue, 18 May 2021 09:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621331325; bh=s9Bz6q2x/QfoapW/bvF+kNoVHzS747ZjQm5kJMTQ8ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h7zS00zStct6l9agEnN+I9aZki2iULUfO6eXw/xDHXgUQvmUu3xE/mUjpzT3DviMR 3amO2G0va/GqityTOw3Etvhd/5exc6AAUv0WSMO3L6kaRkWICFIdgeMhZjWGK816lk lkCsAcHxy5SKh+ZfEbO0jca7RfulSvydQQfkm2u0stlKeh2bGqmYsnbogjv1+RcZnQ RYsaP+5wET5HnX/2kYsZAaix6vD1ujhvVw7FfH7F94gkZ2T2Ny9c9sjuVZUQc1BLY+ ltA+vSja2r8ubSMaD2LcQ7Af0AvqYzrpweCKQ+qccs9EZ9XBDWjPs4k7uwcrTU0CT7 /ia6iySGKWlpA== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com Subject: [PATCH v6 19/21] arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0 Date: Tue, 18 May 2021 10:47:23 +0100 Message-Id: <20210518094725.7701-20-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210518094725.7701-1-will@kernel.org> References: <20210518094725.7701-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_024845_796020_EB5B550F X-CRM114-Status: GOOD ( 12.36 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 | 8 ++++++++ arch/arm64/kernel/cpufeature.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index cb89dbdedc46..a2e453919bb6 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -287,6 +287,14 @@ 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 + and hot-unplug operations may be restricted. + 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 72efdc611b14..f2c97baa050f 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1298,6 +1298,13 @@ const struct cpumask *system_32bit_el0_cpumask(void) return cpu_possible_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) { -- 2.31.1.751.gd2f1c929bd-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel