[PATCH] powerpc: Allow non zero boot cpuids
We currently have a hack to flip the boot cpu and its secondary thread to logical cpuid 0 and 1. This means the logical - physical mapping will differ depending on which cpu is boot cpu. This is most apparent on kexec, where we might kexec on any cpu and therefore change the mapping from boot to boot. The patch below does a first pass early on to work out the logical cpuid of the boot thread. We then fix up some paca structures to match. Ive also removed the boot_cpuid_phys variable for ppc64, to be consistent we use get_hard_smp_processor_id(boot_cpuid) everywhere. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
b4f382a3e5
commit
4df20460a3
@@ -56,14 +56,11 @@ struct lppaca lppaca[] = {
|
||||
* processors. The processor VPD array needs one entry per physical
|
||||
* processor (not thread).
|
||||
*/
|
||||
#define PACA_INIT_COMMON(number, start, asrr, asrv) \
|
||||
#define PACA_INIT_COMMON(number) \
|
||||
.lppaca_ptr = &lppaca[number], \
|
||||
.lock_token = 0x8000, \
|
||||
.paca_index = (number), /* Paca Index */ \
|
||||
.kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \
|
||||
.stab_real = (asrr), /* Real pointer to segment table */ \
|
||||
.stab_addr = (asrv), /* Virt pointer to segment table */ \
|
||||
.cpu_start = (start), /* Processor start */ \
|
||||
.hw_cpu_id = 0xffff,
|
||||
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
@@ -72,30 +69,20 @@ struct lppaca lppaca[] = {
|
||||
|
||||
#define PACA_INIT(number) \
|
||||
{ \
|
||||
PACA_INIT_COMMON(number, 0, 0, 0) \
|
||||
PACA_INIT_ISERIES(number) \
|
||||
}
|
||||
|
||||
#define BOOTCPU_PACA_INIT(number) \
|
||||
{ \
|
||||
PACA_INIT_COMMON(number, 1, 0, (u64)&initial_stab) \
|
||||
PACA_INIT_COMMON(number) \
|
||||
PACA_INIT_ISERIES(number) \
|
||||
}
|
||||
|
||||
#else
|
||||
#define PACA_INIT(number) \
|
||||
{ \
|
||||
PACA_INIT_COMMON(number, 0, 0, 0) \
|
||||
PACA_INIT_COMMON(number) \
|
||||
}
|
||||
|
||||
#define BOOTCPU_PACA_INIT(number) \
|
||||
{ \
|
||||
PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, (u64)&initial_stab) \
|
||||
}
|
||||
#endif
|
||||
|
||||
struct paca_struct paca[] = {
|
||||
BOOTCPU_PACA_INIT(0),
|
||||
PACA_INIT(0),
|
||||
#if NR_CPUS > 1
|
||||
PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3),
|
||||
#if NR_CPUS > 4
|
||||
|
Reference in New Issue
Block a user