Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95856
b: refs/heads/master
c: 3b57506
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed May 2, 2008
1 parent 0d493b5 commit d738610
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d9f2f3f537acb8aa04280509b2eed50c855fd3ef
refs/heads/master: 3b5750644b2ffa2a76fdfe7b4e00e4af2ecf3539
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ static void __init smp_create_idle(unsigned int cpu)
panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
#ifdef CONFIG_PPC64
paca[cpu].__current = p;
paca[cpu].kstack = (unsigned long) task_thread_info(p)
+ THREAD_SIZE - STACK_FRAME_OVERHEAD;
#endif
current_set[cpu] = task_thread_info(p);
task_thread_info(p)->cpu = cpu;
Expand Down
21 changes: 13 additions & 8 deletions trunk/arch/powerpc/mm/slb.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ static void slb_allocate(unsigned long ea)
slb_allocate_realmode(ea);
}

#define slb_esid_mask(ssize) \
(((ssize) == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T)

static inline unsigned long mk_esid_data(unsigned long ea, int ssize,
unsigned long slot)
{
unsigned long mask;

mask = (ssize == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T;
return (ea & mask) | SLB_ESID_V | slot;
return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
}

#define slb_vsid_shift(ssize) \
Expand Down Expand Up @@ -301,11 +301,16 @@ void slb_initialize(void)

create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);

/* For the boot cpu, we're running on the stack in init_thread_union,
* which is in the first segment of the linear mapping, and also
* get_paca()->kstack hasn't been initialized yet.
* For secondary cpus, we need to bolt the kernel stack entry now.
*/
slb_shadow_clear(2);
if (raw_smp_processor_id() != boot_cpuid &&
(get_paca()->kstack & slb_esid_mask(mmu_kernel_ssize)) > PAGE_OFFSET)
create_shadowed_slbe(get_paca()->kstack,
mmu_kernel_ssize, lflags, 2);

/* We don't bolt the stack for the time being - we're in boot,
* so the stack is in the bolted segment. By the time it goes
* elsewhere, we'll call _switch() which will bolt in the new
* one. */
asm volatile("isync":::"memory");
}

0 comments on commit d738610

Please sign in to comment.