// SPDX-License-Identifier: GPL-2.0-or-later/* * SMP support for ppc. * * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great * deal of code from the sparc and intel versions. * * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> * * PowerPC-64 Support added by Dave Engebretsen, Peter Bergner, and * Mike Corrigan {engebret|bergner|mikec}@us.ibm.com */#undef DEBUG#include<linux/kernel.h>#include<linux/export.h>#include<linux/sched/mm.h>#include<linux/sched/task_stack.h>#include<linux/sched/topology.h>#include<linux/smp.h>#include<linux/interrupt.h>#include<linux/delay.h>#include<linux/init.h>#include<linux/spinlock.h>#include<linux/cache.h>#include<linux/err.h>#include<linux/device.h>#include<linux/cpu.h>#include<linux/notifier.h>#include<linux/topology.h>#include<linux/profile.h>#include<linux/processor.h>#include<linux/random.h>#include<linux/stackprotector.h>#include<asm/ptrace.h>#include<linux/atomic.h>#include<asm/irq.h>#include<asm/hw_irq.h>#include<asm/kvm_ppc.h>#include<asm/dbell.h>#include<asm/page.h>#include<asm/pgtable.h>#include<asm/prom.h>#include<asm/smp.h>#include<asm/time.h>#include<asm/machdep.h>#include<asm/cputhreads.h>#include<asm/cputable.h>#include<asm/mpic.h>#include<asm/vdso_datapage.h>#ifdef CONFIG_PPC64#include<asm/paca.h>#endif#include<asm/vdso.h>#include<asm/debug.h>#include<asm/kexec.h>#include<asm/asm-prototypes.h>#include<asm/cpu_has_feature.h>#include<asm/ftrace.h>#ifdef DEBUG#include<asm/udbg.h>#define DBG(fmt...) udbg_printf(fmt)#else#define DBG(fmt...)#endif#ifdef CONFIG_HOTPLUG_CPU/* State of each CPU during hotplug phases */staticDEFINE_PER_CPU(int,cpu_state)={0};#endifstructtask_struct*secondary_current;boolhas_big_cores