Skip to content

Commit 94f9c00

Browse files
willdeaconPeter Zijlstra
authored andcommitted
arm64: Remove logic to kill 32-bit tasks on 64-bit-only cores
The scheduler now knows enough about these braindead systems to place 32-bit tasks accordingly, so throw out the safety checks and allow the ret-to-user path to avoid do_notify_resume() if there is nothing to do. Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ead7de4 commit 94f9c00

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

arch/arm64/kernel/process.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,6 @@ static void erratum_1418040_thread_switch(struct task_struct *prev,
469469
write_sysreg(val, cntkctl_el1);
470470
}
471471

472-
static void compat_thread_switch(struct task_struct *next)
473-
{
474-
if (!is_compat_thread(task_thread_info(next)))
475-
return;
476-
477-
if (static_branch_unlikely(&arm64_mismatched_32bit_el0))
478-
set_tsk_thread_flag(next, TIF_NOTIFY_RESUME);
479-
}
480-
481472
static void update_sctlr_el1(u64 sctlr)
482473
{
483474
/*
@@ -519,7 +510,6 @@ __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev,
519510
ssbs_thread_switch(next);
520511
erratum_1418040_thread_switch(prev, next);
521512
ptrauth_thread_switch_user(next);
522-
compat_thread_switch(next);
523513

524514
/*
525515
* Complete any pending TLB or cache maintenance on this CPU in case
@@ -621,10 +611,8 @@ void arch_setup_new_exec(void)
621611
* at the point of execve(), although we try a bit harder to
622612
* honour the cpuset hierarchy.
623613
*/
624-
if (static_branch_unlikely(&arm64_mismatched_32bit_el0)) {
614+
if (static_branch_unlikely(&arm64_mismatched_32bit_el0))
625615
force_compatible_cpus_allowed_ptr(current);
626-
set_tsk_thread_flag(current, TIF_NOTIFY_RESUME);
627-
}
628616
} else if (static_branch_unlikely(&arm64_mismatched_32bit_el0)) {
629617
relax_compatible_cpus_allowed_ptr(current);
630618
}

arch/arm64/kernel/signal.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -912,19 +912,6 @@ static void do_signal(struct pt_regs *regs)
912912
restore_saved_sigmask();
913913
}
914914

915-
static bool cpu_affinity_invalid(struct pt_regs *regs)
916-
{
917-
if (!compat_user_mode(regs))
918-
return false;
919-
920-
/*
921-
* We're preemptible, but a reschedule will cause us to check the
922-
* affinity again.
923-
*/
924-
return !cpumask_test_cpu(raw_smp_processor_id(),
925-
system_32bit_el0_cpumask());
926-
}
927-
928915
asmlinkage void do_notify_resume(struct pt_regs *regs,
929916
unsigned long thread_flags)
930917
{
@@ -952,19 +939,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
952939
if (thread_flags & _TIF_NOTIFY_RESUME) {
953940
tracehook_notify_resume(regs);
954941
rseq_handle_notify_resume(NULL, regs);
955-
956-
/*
957-
* If we reschedule after checking the affinity
958-
* then we must ensure that TIF_NOTIFY_RESUME
959-
* is set so that we check the affinity again.
960-
* Since tracehook_notify_resume() clears the
961-
* flag, ensure that the compiler doesn't move
962-
* it after the affinity check.
963-
*/
964-
barrier();
965-
966-
if (cpu_affinity_invalid(regs))
967-
force_sig(SIGKILL);
968942
}
969943

970944
if (thread_flags & _TIF_FOREIGN_FPSTATE)

0 commit comments

Comments
 (0)