Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1655159pxj; Wed, 19 May 2021 10:44:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhfpIyQnIRCFuaovfrxafEIg2uUhNHL0L9V3D7Oo7vBEnL115f2Z5ycBbb2sX99CsGUPve X-Received: by 2002:a6b:144e:: with SMTP id 75mr609473iou.62.1621446268428; Wed, 19 May 2021 10:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621446268; cv=none; d=google.com; s=arc-20160816; b=OfCm4cj57wwz3TfXaaeXWv61RjdCwPeteZl7wDZp4A2J7fiv0it9zrcIdlmXz6E1VU SyBqyXLmZWhFT2KmMak6DfOOino/JQHEbOMOH9JEfR3TleF78HIL/+JdV9DjTmW2dI9U XSMwlkIBxuo8SIg9N4Nsb4jPYDspMCxRPvWqKMM6PNg4vAsGu443OyaBFrWXe0diMh5h uJ/oDfZkOpz56DsuOWOE/sZcp2y+X9yk0SfB9qfv8TkYKT8ARQ2tOxKf/3GTJIS6aGBk 1aB+yqlQspHdeLzsZZ1MYodAUv9DEMsXv2YybOg/dIVIMDpZy8mpdv+IiZDzcSX7BguU xoog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H1u3jivJEPCiVXSzPUEDO4O32WzfJt0Yji9f9bgjb4o=; b=Norw4uf9tf6yd7Pf75AWcnGTvzm9lF9YO4RaHH4C5thp1wjXx7xuviw0UXozZtZQTY hmD2TOFR/3pht+eBTt6TAAIyzTX6d5f9vDgsHH94YUUnOk8yxOUM9sTUpg5lA/pfISbZ tgOFs8JmMo1PwFNbVmIQfG9o6czuNRI9/2qAyt34B6Iqsm3atxLrWkAzAnwriRK0cN4N tlz73GzpY2NUdfCAsvqeGvFSHKADf4xN5KwXph9wqTey5jdjDOxZ3WkEG5NNC9eomj+7 Wsqs8gvBGt/D2BSnfzjX8623fZBELgAGcIqI4nXWJ73weX+lHIMo4Ij2WRpWVGiOsfgq 4Lnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h7zS00zS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w135si28786801jaw.24.2021.05.19.10.44.14; Wed, 19 May 2021 10:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h7zS00zS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243543AbhERJu7 (ORCPT + 99 others); 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