Skip to content

Commit 4a1567b

Browse files
author
Frederic Weisbecker
committed
arm64: Exclude nohz_full CPUs from 32bits el0 support
Nohz full CPUs are not a desirable fallback target to run 32bits el0 applications. If present, prefer a set of housekeeping CPUs that can do the job instead. Otherwise just don't support el0 32 bits. Should the need arise, appropriate support can be introduced in the future. Suggested-by: Will Deacon <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 192faeb commit 4a1567b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Documentation/arch/arm64/asymmetric-32bit.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,11 @@ asymmetric system, a broken guest at EL1 could still attempt to execute
153153
mode will return to host userspace with an ``exit_reason`` of
154154
``KVM_EXIT_FAIL_ENTRY`` and will remain non-runnable until successfully
155155
re-initialised by a subsequent ``KVM_ARM_VCPU_INIT`` operation.
156+
157+
NOHZ FULL
158+
---------
159+
160+
To avoid perturbing an adaptive-ticks CPU (specified using
161+
``nohz_full=``) when a 32-bit task is forcefully migrated, these CPUs
162+
are treated as 64-bit-only when support for asymmetric 32-bit systems
163+
is enabled.

arch/arm64/kernel/cpufeature.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#include <linux/cpu.h>
7676
#include <linux/kasan.h>
7777
#include <linux/percpu.h>
78+
#include <linux/sched/isolation.h>
7879

7980
#include <asm/cpu.h>
8081
#include <asm/cpufeature.h>
@@ -3742,7 +3743,14 @@ static int enable_mismatched_32bit_el0(unsigned int cpu)
37423743
static int lucky_winner = -1;
37433744

37443745
struct cpuinfo_arm64 *info = &per_cpu(cpu_data, cpu);
3745-
bool cpu_32bit = id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0);
3746+
bool cpu_32bit = false;
3747+
3748+
if (id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0)) {
3749+
if (!housekeeping_cpu(cpu, HK_TYPE_TICK))
3750+
pr_info("Treating adaptive-ticks CPU %u as 64-bit only\n", cpu);
3751+
else
3752+
cpu_32bit = true;
3753+
}
37463754

37473755
if (cpu_32bit) {
37483756
cpumask_set_cpu(cpu, cpu_32bit_el0_mask);

0 commit comments

Comments
 (0)