Skip to content

Commit d82158f

Browse files
willdeaconPeter Zijlstra
authored andcommitted
arm64: Implement task_cpu_possible_mask()
Provide an implementation of task_cpu_possible_mask() so that we can prevent 64-bit-only cores being added to the 'cpus_mask' for compat tasks on systems with mismatched 32-bit support at EL0, 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 c94d89f commit d82158f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arch/arm64/include/asm/mmu_context.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,19 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
231231
update_saved_ttbr0(tsk, next);
232232
}
233233

234+
static inline const struct cpumask *
235+
task_cpu_possible_mask(struct task_struct *p)
236+
{
237+
if (!static_branch_unlikely(&arm64_mismatched_32bit_el0))
238+
return cpu_possible_mask;
239+
240+
if (!is_compat_thread(task_thread_info(p)))
241+
return cpu_possible_mask;
242+
243+
return system_32bit_el0_cpumask();
244+
}
245+
#define task_cpu_possible_mask task_cpu_possible_mask
246+
234247
void verify_cpu_asid_bits(void);
235248
void post_ttbr_update_workaround(void);
236249

0 commit comments

Comments
 (0)