diff options
| author | Will Deacon <will@kernel.org> | 2021-06-24 13:30:13 +0100 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2021-06-24 13:30:13 +0100 |
| commit | e7cf636cba4cf0650169ddbc449645d03a5eedae (patch) | |
| tree | 970453af57d6d9991710d15cdede5fc0ef7704de /arch/arm64/kernel/smp.c | |
| parent | 0b573a025aa65e9c6634fb230c5aebe14cc677d9 (diff) | |
| parent | 16c230b30de8b69ae75d2b98d04a77904da58d15 (diff) | |
Merge branch 'for-next/boot' into for-next/core
Boot path cleanups to enable early initialisation of per-cpu operations
needed by KCSAN.
* for-next/boot:
arm64: scs: Drop unused 'tmp' argument to scs_{load, save} asm macros
arm64: smp: initialize cpu offset earlier
arm64: smp: unify task and sp setup
arm64: smp: remove stack from secondary_data
arm64: smp: remove pointless secondary_data maintenance
arm64: assembler: add set_this_cpu_offset
Diffstat (limited to 'arch/arm64/kernel/smp.c')
| -rw-r--r-- | arch/arm64/kernel/smp.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index dcd7041b2b07..2fe8fab886e2 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -120,9 +120,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) * page tables. */ secondary_data.task = idle; - secondary_data.stack = task_stack_page(idle) + THREAD_SIZE; update_cpu_boot_status(CPU_MMU_OFF); - __flush_dcache_area(&secondary_data, sizeof(secondary_data)); /* Now bring the CPU into our world */ ret = boot_secondary(cpu, idle); @@ -142,8 +140,6 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) pr_crit("CPU%u: failed to come online\n", cpu); secondary_data.task = NULL; - secondary_data.stack = NULL; - __flush_dcache_area(&secondary_data, sizeof(secondary_data)); status = READ_ONCE(secondary_data.status); if (status == CPU_MMU_OFF) status = READ_ONCE(__early_cpu_boot_status); @@ -202,10 +198,7 @@ asmlinkage notrace void secondary_start_kernel(void) u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; struct mm_struct *mm = &init_mm; const struct cpu_operations *ops; - unsigned int cpu; - - cpu = task_cpu(current); - set_my_cpu_offset(per_cpu_offset(cpu)); + unsigned int cpu = smp_processor_id(); /* * All kernel threads share the same mm context; grab a @@ -452,6 +445,11 @@ void __init smp_cpus_done(unsigned int max_cpus) void __init smp_prepare_boot_cpu(void) { + /* + * The runtime per-cpu areas have been allocated by + * setup_per_cpu_areas(), and CPU0's boot time per-cpu area will be + * freed shortly, so we must move over to the runtime per-cpu area. + */ set_my_cpu_offset(per_cpu_offset(smp_processor_id())); cpuinfo_store_boot_cpu(); |
