diff options
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 24 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/plpar_wrappers.h | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 12 |
3 files changed, 40 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 6cbf14266d5e..1820a0b0a8c6 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -252,18 +252,34 @@ out: | |||
252 | void vpa_init(int cpu) | 252 | void vpa_init(int cpu) |
253 | { | 253 | { |
254 | int hwcpu = get_hard_smp_processor_id(cpu); | 254 | int hwcpu = get_hard_smp_processor_id(cpu); |
255 | unsigned long vpa = __pa(&lppaca[cpu]); | 255 | unsigned long addr; |
256 | long ret; | 256 | long ret; |
257 | 257 | ||
258 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) | 258 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) |
259 | lppaca[cpu].vmxregs_in_use = 1; | 259 | lppaca[cpu].vmxregs_in_use = 1; |
260 | 260 | ||
261 | ret = register_vpa(hwcpu, vpa); | 261 | addr = __pa(&lppaca[cpu]); |
262 | ret = register_vpa(hwcpu, addr); | ||
262 | 263 | ||
263 | if (ret) | 264 | if (ret) { |
264 | printk(KERN_ERR "WARNING: vpa_init: VPA registration for " | 265 | printk(KERN_ERR "WARNING: vpa_init: VPA registration for " |
265 | "cpu %d (hw %d) of area %lx returns %ld\n", | 266 | "cpu %d (hw %d) of area %lx returns %ld\n", |
266 | cpu, hwcpu, vpa, ret); | 267 | cpu, hwcpu, addr, ret); |
268 | return; | ||
269 | } | ||
270 | /* | ||
271 | * PAPR says this feature is SLB-Buffer but firmware never | ||
272 | * reports that. All SPLPAR support SLB shadow buffer. | ||
273 | */ | ||
274 | addr = __pa(&slb_shadow[cpu]); | ||
275 | if (firmware_has_feature(FW_FEATURE_SPLPAR)) { | ||
276 | ret = register_slb_shadow(hwcpu, addr); | ||
277 | if (ret) | ||
278 | printk(KERN_ERR | ||
279 | "WARNING: vpa_init: SLB shadow buffer " | ||
280 | "registration for cpu %d (hw %d) of area %lx " | ||
281 | "returns %ld\n", cpu, hwcpu, addr, ret); | ||
282 | } | ||
267 | } | 283 | } |
268 | 284 | ||
269 | long pSeries_lpar_hpte_insert(unsigned long hpte_group, | 285 | long pSeries_lpar_hpte_insert(unsigned long hpte_group, |
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index ebd15de7597e..3eb7b294d92f 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -37,6 +37,16 @@ static inline long register_vpa(unsigned long cpu, unsigned long vpa) | |||
37 | return vpa_call(0x1, cpu, vpa); | 37 | return vpa_call(0x1, cpu, vpa); |
38 | } | 38 | } |
39 | 39 | ||
40 | static inline long unregister_slb_shadow(unsigned long cpu, unsigned long vpa) | ||
41 | { | ||
42 | return vpa_call(0x7, cpu, vpa); | ||
43 | } | ||
44 | |||
45 | static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa) | ||
46 | { | ||
47 | return vpa_call(0x3, cpu, vpa); | ||
48 | } | ||
49 | |||
40 | extern void vpa_init(int cpu); | 50 | extern void vpa_init(int cpu); |
41 | 51 | ||
42 | static inline long plpar_pte_enter(unsigned long flags, | 52 | static inline long plpar_pte_enter(unsigned long flags, |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index de214d86ff44..6ebeecfd6bcb 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -234,9 +234,17 @@ static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) | |||
234 | { | 234 | { |
235 | /* Don't risk a hypervisor call if we're crashing */ | 235 | /* Don't risk a hypervisor call if we're crashing */ |
236 | if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { | 236 | if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { |
237 | unsigned long vpa = __pa(get_lppaca()); | 237 | unsigned long addr; |
238 | 238 | ||
239 | if (unregister_vpa(hard_smp_processor_id(), vpa)) { | 239 | addr = __pa(get_slb_shadow()); |
240 | if (unregister_slb_shadow(hard_smp_processor_id(), addr)) | ||
241 | printk("SLB shadow buffer deregistration of " | ||
242 | "cpu %u (hw_cpu_id %d) failed\n", | ||
243 | smp_processor_id(), | ||
244 | hard_smp_processor_id()); | ||
245 | |||
246 | addr = __pa(get_lppaca()); | ||
247 | if (unregister_vpa(hard_smp_processor_id(), addr)) { | ||
240 | printk("VPA deregistration of cpu %u (hw_cpu_id %d) " | 248 | printk("VPA deregistration of cpu %u (hw_cpu_id %d) " |
241 | "failed\n", smp_processor_id(), | 249 | "failed\n", smp_processor_id(), |
242 | hard_smp_processor_id()); | 250 | hard_smp_processor_id()); |