diff options
author | Keith Packard <keithpac@amazon.com> | 2021-09-18 10:44:35 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2021-09-27 16:54:01 +0200 |
commit | 19f29aebd929c31c5cc901f38a9295617b602c38 (patch) | |
tree | 3d021fe74ab2bdc9563291d4daa6f03a252b12ce /arch/arm/kernel/smp.c | |
parent | dfbdcda280eb762bae2184145cc0702932d41798 (diff) | |
download | linux-stable-19f29aebd929c31c5cc901f38a9295617b602c38.tar.gz linux-stable-19f29aebd929c31c5cc901f38a9295617b602c38.tar.bz2 linux-stable-19f29aebd929c31c5cc901f38a9295617b602c38.zip |
ARM: smp: Pass task to secondary_start_kernel
This avoids needing to compute the task pointer in this function, which
will no longer be possible once we move thread_info off the stack.
Signed-off-by: Keith Packard <keithpac@amazon.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Diffstat (limited to 'arch/arm/kernel/smp.c')
-rw-r--r-- | arch/arm/kernel/smp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 842427ff2b3c..8979d548ec17 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -153,6 +153,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) secondary_data.pgdir = virt_to_phys(idmap_pgd); secondary_data.swapper_pg_dir = get_arch_pgd(swapper_pg_dir); #endif + secondary_data.task = idle; sync_cache_w(&secondary_data); /* @@ -375,9 +376,12 @@ void arch_cpu_idle_dead(void) */ __asm__("mov sp, %0\n" " mov fp, #0\n" + " mov r0, %1\n" " b secondary_start_kernel" : - : "r" (task_stack_page(current) + THREAD_SIZE - 8)); + : "r" (task_stack_page(current) + THREAD_SIZE - 8), + "r" (current) + : "r0"); } #endif /* CONFIG_HOTPLUG_CPU */ @@ -400,7 +404,7 @@ static void smp_store_cpu_info(unsigned int cpuid) * This is the secondary CPU boot entry. We're using this CPUs * idle thread stack, but a set of temporary page tables. */ -asmlinkage void secondary_start_kernel(void) +asmlinkage void secondary_start_kernel(struct task_struct *task) { struct mm_struct *mm = &init_mm; unsigned int cpu; |