aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c10
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h19
-rw-r--r--include/asm-ppc64/smp.h8
3 files changed, 19 insertions, 18 deletions
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8a7bda3db677..e384a5a91796 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -261,22 +261,18 @@ out:
261void vpa_init(int cpu) 261void vpa_init(int cpu)
262{ 262{
263 int hwcpu = get_hard_smp_processor_id(cpu); 263 int hwcpu = get_hard_smp_processor_id(cpu);
264 unsigned long vpa = (unsigned long)&(paca[cpu].lppaca); 264 unsigned long vpa = __pa(&paca[cpu].lppaca);
265 long ret; 265 long ret;
266 unsigned long flags;
267
268 /* Register the Virtual Processor Area (VPA) */
269 flags = 1UL << (63 - 18);
270 266
271 if (cpu_has_feature(CPU_FTR_ALTIVEC)) 267 if (cpu_has_feature(CPU_FTR_ALTIVEC))
272 paca[cpu].lppaca.vmxregs_in_use = 1; 268 paca[cpu].lppaca.vmxregs_in_use = 1;
273 269
274 ret = register_vpa(flags, hwcpu, __pa(vpa)); 270 ret = register_vpa(hwcpu, vpa);
275 271
276 if (ret) 272 if (ret)
277 printk(KERN_ERR "WARNING: vpa_init: VPA registration for " 273 printk(KERN_ERR "WARNING: vpa_init: VPA registration for "
278 "cpu %d (hw %d) of area %lx returns %ld\n", 274 "cpu %d (hw %d) of area %lx returns %ld\n",
279 cpu, hwcpu, __pa(vpa), ret); 275 cpu, hwcpu, vpa, ret);
280} 276}
281 277
282long pSeries_lpar_hpte_insert(unsigned long hpte_group, 278long 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 2457be2e217e..382f8c5b0e7c 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -21,13 +21,26 @@ static inline long cede_processor(void)
21 return 0; 21 return 0;
22} 22}
23 23
24static inline long register_vpa(unsigned long flags, unsigned long proc, 24static inline long vpa_call(unsigned long flags, unsigned long cpu,
25 unsigned long vpa) 25 unsigned long vpa)
26{ 26{
27 return plpar_hcall_norets(H_REGISTER_VPA, flags, proc, vpa); 27 /* flags are in bits 16-18 (counting from most significant bit) */
28 flags = flags << (63 - 18);
29
30 return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
31}
32
33static inline long unregister_vpa(unsigned long cpu, unsigned long vpa)
34{
35 return vpa_call(0x5, cpu, vpa);
36}
37
38static inline long register_vpa(unsigned long cpu, unsigned long vpa)
39{
40 return vpa_call(0x1, cpu, vpa);
28} 41}
29 42
30void vpa_init(int cpu); 43extern void vpa_init(int cpu);
31 44
32static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex, 45static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex,
33 unsigned long avpn, unsigned long *old_pteh_ret, 46 unsigned long avpn, unsigned long *old_pteh_ret,
diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h
index 0f42fcc1900b..46c04046952d 100644
--- a/include/asm-ppc64/smp.h
+++ b/include/asm-ppc64/smp.h
@@ -85,14 +85,6 @@ extern void smp_generic_take_timebase(void);
85 85
86extern struct smp_ops_t *smp_ops; 86extern struct smp_ops_t *smp_ops;
87 87
88#ifdef CONFIG_PPC_PSERIES
89void vpa_init(int cpu);
90#else
91static inline void vpa_init(int cpu)
92{
93}
94#endif /* CONFIG_PPC_PSERIES */
95
96#endif /* __ASSEMBLY__ */ 88#endif /* __ASSEMBLY__ */
97 89
98#endif /* !(_PPC64_SMP_H) */ 90#endif /* !(_PPC64_SMP_H) */