diff options
| -rw-r--r-- | arch/powerpc/kernel/smp.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/mm/slb.c | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index be35ffae10f0..1457aa0a08f1 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
| @@ -386,6 +386,8 @@ static void __init smp_create_idle(unsigned int cpu) | |||
| 386 | panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); | 386 | panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); |
| 387 | #ifdef CONFIG_PPC64 | 387 | #ifdef CONFIG_PPC64 |
| 388 | paca[cpu].__current = p; | 388 | paca[cpu].__current = p; |
| 389 | paca[cpu].kstack = (unsigned long) task_thread_info(p) | ||
| 390 | + THREAD_SIZE - STACK_FRAME_OVERHEAD; | ||
| 389 | #endif | 391 | #endif |
| 390 | current_set[cpu] = task_thread_info(p); | 392 | current_set[cpu] = task_thread_info(p); |
| 391 | task_thread_info(p)->cpu = cpu; | 393 | task_thread_info(p)->cpu = cpu; |
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c index 497ec059bc82..cf8705e32d60 100644 --- a/arch/powerpc/mm/slb.c +++ b/arch/powerpc/mm/slb.c | |||
| @@ -44,13 +44,13 @@ static void slb_allocate(unsigned long ea) | |||
| 44 | slb_allocate_realmode(ea); | 44 | slb_allocate_realmode(ea); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | #define slb_esid_mask(ssize) \ | ||
| 48 | (((ssize) == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T) | ||
| 49 | |||
| 47 | static inline unsigned long mk_esid_data(unsigned long ea, int ssize, | 50 | static inline unsigned long mk_esid_data(unsigned long ea, int ssize, |
| 48 | unsigned long slot) | 51 | unsigned long slot) |
| 49 | { | 52 | { |
| 50 | unsigned long mask; | 53 | return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot; |
| 51 | |||
| 52 | mask = (ssize == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T; | ||
| 53 | return (ea & mask) | SLB_ESID_V | slot; | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | #define slb_vsid_shift(ssize) \ | 56 | #define slb_vsid_shift(ssize) \ |
| @@ -301,11 +301,16 @@ void slb_initialize(void) | |||
| 301 | 301 | ||
| 302 | create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1); | 302 | create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1); |
| 303 | 303 | ||
| 304 | /* For the boot cpu, we're running on the stack in init_thread_union, | ||
| 305 | * which is in the first segment of the linear mapping, and also | ||
| 306 | * get_paca()->kstack hasn't been initialized yet. | ||
| 307 | * For secondary cpus, we need to bolt the kernel stack entry now. | ||
| 308 | */ | ||
| 304 | slb_shadow_clear(2); | 309 | slb_shadow_clear(2); |
| 310 | if (raw_smp_processor_id() != boot_cpuid && | ||
| 311 | (get_paca()->kstack & slb_esid_mask(mmu_kernel_ssize)) > PAGE_OFFSET) | ||
| 312 | create_shadowed_slbe(get_paca()->kstack, | ||
| 313 | mmu_kernel_ssize, lflags, 2); | ||
| 305 | 314 | ||
| 306 | /* We don't bolt the stack for the time being - we're in boot, | ||
| 307 | * so the stack is in the bolted segment. By the time it goes | ||
| 308 | * elsewhere, we'll call _switch() which will bolt in the new | ||
| 309 | * one. */ | ||
| 310 | asm volatile("isync":::"memory"); | 315 | asm volatile("isync":::"memory"); |
| 311 | } | 316 | } |
