From d6ad86a43e3ed69352e799c364439de5e35198c8 Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Thu, 14 Apr 2022 15:47:37 -0700 Subject: [PATCH] sched/walt: check for incorrect cpu assignment When a task is in execve, it can be assigned to any cpu regardless of its status as a 32bit task. However, once execve is done, the task needs to be assigned to a 32 bit cpu. Capture the case where a 32 bit task, not in execve, is assigned to an incorrect cpu. Change-Id: I7880521716f6ed16d81aad13e42c0ad4374bab15 Signed-off-by: Stephen Dickey --- kernel/sched/walt/walt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/walt/walt.c b/kernel/sched/walt/walt.c index a6c45b85fd0c..a578ecce0376 100644 --- a/kernel/sched/walt/walt.c +++ b/kernel/sched/walt/walt.c @@ -3983,6 +3983,13 @@ static void android_rvh_set_task_cpu(void *unused, struct task_struct *p, unsign if (!cpumask_test_cpu(new_cpu, p->cpus_ptr)) WALT_BUG(WALT_BUG_WALT, p, "selecting unaffined cpu=%d comm=%s(%d) affinity=0x%x", new_cpu, p->comm, p->pid, (*(cpumask_bits(p->cpus_ptr)))); + + if (!p->in_execve && + is_compat_thread(task_thread_info(p)) && + !cpumask_test_cpu(new_cpu, system_32bit_el0_cpumask())) + WALT_BUG(WALT_BUG_WALT, p, + "selecting non 32 bit cpu=%d comm=%s(%d) 32bit_cpus=0x%x", + new_cpu, p->comm, p->pid, (*(cpumask_bits(system_32bit_el0_cpumask())))); } static void android_rvh_new_task_stats(void *unused, struct task_struct *p)