diff options
author | Anton Blanchard <anton@samba.org> | 2006-03-25 01:25:17 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-26 22:48:48 -0500 |
commit | 4df20460a3ff0d60280738b094945c56cb5567a5 (patch) | |
tree | 39f831cf5f778b14a08b3453a8f798b2b8be8813 /arch/powerpc/kernel/head_64.S | |
parent | b4f382a3e5e20ba867e7aa5b01189a3fd40eea2c (diff) |
[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>
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 7e7f7d243304..a5ae04a57c78 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -1851,21 +1851,6 @@ _STATIC(start_here_multiplatform) | |||
1851 | bl .__save_cpu_setup | 1851 | bl .__save_cpu_setup |
1852 | sync | 1852 | sync |
1853 | 1853 | ||
1854 | /* Setup a valid physical PACA pointer in SPRG3 for early_setup | ||
1855 | * note that boot_cpuid can always be 0 nowadays since there is | ||
1856 | * nowhere it can be initialized differently before we reach this | ||
1857 | * code | ||
1858 | */ | ||
1859 | LOAD_REG_IMMEDIATE(r27, boot_cpuid) | ||
1860 | add r27,r27,r26 | ||
1861 | lwz r27,0(r27) | ||
1862 | |||
1863 | LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ | ||
1864 | mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ | ||
1865 | add r13,r13,r24 /* for this processor. */ | ||
1866 | add r13,r13,r26 /* convert to physical addr */ | ||
1867 | mtspr SPRN_SPRG3,r13 | ||
1868 | |||
1869 | /* Do very early kernel initializations, including initial hash table, | 1854 | /* Do very early kernel initializations, including initial hash table, |
1870 | * stab and slb setup before we turn on relocation. */ | 1855 | * stab and slb setup before we turn on relocation. */ |
1871 | 1856 | ||
@@ -1934,6 +1919,17 @@ _STATIC(start_here_common) | |||
1934 | /* Not reached */ | 1919 | /* Not reached */ |
1935 | BUG_OPCODE | 1920 | BUG_OPCODE |
1936 | 1921 | ||
1922 | /* Put the paca pointer into r13 and SPRG3 */ | ||
1923 | _GLOBAL(setup_boot_paca) | ||
1924 | LOAD_REG_IMMEDIATE(r3, boot_cpuid) | ||
1925 | lwz r3,0(r3) | ||
1926 | LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */ | ||
1927 | mulli r3,r3,PACA_SIZE /* Calculate vaddr of right paca */ | ||
1928 | add r13,r3,r4 /* for this processor. */ | ||
1929 | mtspr SPRN_SPRG3,r13 | ||
1930 | |||
1931 | blr | ||
1932 | |||
1937 | /* | 1933 | /* |
1938 | * We put a few things here that have to be page-aligned. | 1934 | * We put a few things here that have to be page-aligned. |
1939 | * This stuff goes at the beginning of the bss, which is page-aligned. | 1935 | * This stuff goes at the beginning of the bss, which is page-aligned. |