arm64: Hook up cmdline parameter to allow mismatched 32-bit EL0
authorWill Deacon <will@kernel.org>
Fri, 30 Jul 2021 11:24:41 +0000 (12:24 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 20 Aug 2021 10:33:07 +0000 (12:33 +0200)
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 <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210730112443.23245-15-will@kernel.org
Documentation/admin-guide/kernel-parameters.txt
arch/arm64/kernel/cpufeature.c

index bdb2200..6ab625d 100644 (file)
                        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:
index 0a9bc7e..77b2149 100644 (file)
@@ -1322,6 +1322,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)
 {