Commit dfbe0d3b6be52596b5694b1bb75b19562e769021

Authored by Paul Mackerras
1 parent d262c32a4b

[POWERPC] Fix boot failure on POWER6

Commit 473980a99316c0e788bca50996375a2815124ce1 added a call to clear
the SLB shadow buffer before registering it.  Unfortunately this means
that we clear out the entries that slb_initialize has previously set in
there.  On POWER6, the hypervisor uses the SLB shadow buffer when doing
partition switches, and that means that after the next partition switch,
each non-boot CPU has no SLB entries to map the kernel text and data,
which causes it to crash.

This fixes it by reverting most of 473980a9 and instead clearing the
3rd entry explicitly in slb_initialize.  This fixes the problem that
473980a9 was trying to solve, but without breaking POWER6.

Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 3 changed files with 2 additions and 10 deletions Side-by-side Diff

arch/powerpc/mm/slb.c
... ... @@ -82,14 +82,6 @@
82 82 get_slb_shadow()->save_area[entry].esid = 0;
83 83 }
84 84  
85   -void slb_shadow_clear_all(void)
86   -{
87   - int i;
88   -
89   - for (i = 0; i < SLB_NUM_BOLTED; i++)
90   - slb_shadow_clear(i);
91   -}
92   -
93 85 static inline void create_shadowed_slbe(unsigned long ea, int ssize,
94 86 unsigned long flags,
95 87 unsigned long entry)
... ... @@ -299,6 +291,8 @@
299 291 create_shadowed_slbe(PAGE_OFFSET, mmu_kernel_ssize, lflags, 0);
300 292  
301 293 create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
  294 +
  295 + slb_shadow_clear(2);
302 296  
303 297 /* We don't bolt the stack for the time being - we're in boot,
304 298 * so the stack is in the bolted segment. By the time it goes
arch/powerpc/platforms/pseries/lpar.c
... ... @@ -272,7 +272,6 @@
272 272 */
273 273 addr = __pa(&slb_shadow[cpu]);
274 274 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
275   - slb_shadow_clear_all();
276 275 ret = register_slb_shadow(hwcpu, addr);
277 276 if (ret)
278 277 printk(KERN_ERR
include/asm-powerpc/mmu-hash64.h
... ... @@ -286,7 +286,6 @@
286 286 extern void hpte_init_beat(void);
287 287 extern void hpte_init_beat_v3(void);
288 288  
289   -extern void slb_shadow_clear_all(void);
290 289 extern void stabs_alloc(void);
291 290 extern void slb_initialize(void);
292 291 extern void slb_flush_and_rebolt(void);