diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/lpar.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 3aeb40699042..1820a0b0a8c6 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -48,13 +48,11 @@ | |||
48 | #define DBG_LOW(fmt...) do { } while(0) | 48 | #define DBG_LOW(fmt...) do { } while(0) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* in pSeries_hvCall.S */ | 51 | /* in hvCall.S */ |
52 | EXPORT_SYMBOL(plpar_hcall); | 52 | EXPORT_SYMBOL(plpar_hcall); |
53 | EXPORT_SYMBOL(plpar_hcall_4out); | 53 | EXPORT_SYMBOL(plpar_hcall9); |
54 | EXPORT_SYMBOL(plpar_hcall_norets); | 54 | EXPORT_SYMBOL(plpar_hcall_norets); |
55 | EXPORT_SYMBOL(plpar_hcall_8arg_2ret); | 55 | |
56 | EXPORT_SYMBOL(plpar_hcall_7arg_7ret); | ||
57 | EXPORT_SYMBOL(plpar_hcall_9arg_9ret); | ||
58 | extern void pSeries_find_serial_port(void); | 56 | extern void pSeries_find_serial_port(void); |
59 | 57 | ||
60 | 58 | ||
@@ -204,20 +202,20 @@ void __init udbg_init_debug_lpar(void) | |||
204 | void __init find_udbg_vterm(void) | 202 | void __init find_udbg_vterm(void) |
205 | { | 203 | { |
206 | struct device_node *stdout_node; | 204 | struct device_node *stdout_node; |
207 | u32 *termno; | 205 | const u32 *termno; |
208 | char *name; | 206 | const char *name; |
209 | int add_console; | 207 | int add_console; |
210 | 208 | ||
211 | /* find the boot console from /chosen/stdout */ | 209 | /* find the boot console from /chosen/stdout */ |
212 | if (!of_chosen) | 210 | if (!of_chosen) |
213 | return; | 211 | return; |
214 | name = (char *)get_property(of_chosen, "linux,stdout-path", NULL); | 212 | name = get_property(of_chosen, "linux,stdout-path", NULL); |
215 | if (name == NULL) | 213 | if (name == NULL) |
216 | return; | 214 | return; |
217 | stdout_node = of_find_node_by_path(name); | 215 | stdout_node = of_find_node_by_path(name); |
218 | if (!stdout_node) | 216 | if (!stdout_node) |
219 | return; | 217 | return; |
220 | name = (char *)get_property(stdout_node, "name", NULL); | 218 | name = get_property(stdout_node, "name", NULL); |
221 | if (!name) { | 219 | if (!name) { |
222 | printk(KERN_WARNING "stdout node missing 'name' property!\n"); | 220 | printk(KERN_WARNING "stdout node missing 'name' property!\n"); |
223 | goto out; | 221 | goto out; |
@@ -228,7 +226,7 @@ void __init find_udbg_vterm(void) | |||
228 | /* Check if it's a virtual terminal */ | 226 | /* Check if it's a virtual terminal */ |
229 | if (strncmp(name, "vty", 3) != 0) | 227 | if (strncmp(name, "vty", 3) != 0) |
230 | goto out; | 228 | goto out; |
231 | termno = (u32 *)get_property(stdout_node, "reg", NULL); | 229 | termno = get_property(stdout_node, "reg", NULL); |
232 | if (termno == NULL) | 230 | if (termno == NULL) |
233 | goto out; | 231 | goto out; |
234 | vtermno = termno[0]; | 232 | vtermno = termno[0]; |
@@ -254,18 +252,34 @@ out: | |||
254 | void vpa_init(int cpu) | 252 | void vpa_init(int cpu) |
255 | { | 253 | { |
256 | int hwcpu = get_hard_smp_processor_id(cpu); | 254 | int hwcpu = get_hard_smp_processor_id(cpu); |
257 | unsigned long vpa = __pa(&lppaca[cpu]); | 255 | unsigned long addr; |
258 | long ret; | 256 | long ret; |
259 | 257 | ||
260 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) | 258 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) |
261 | lppaca[cpu].vmxregs_in_use = 1; | 259 | lppaca[cpu].vmxregs_in_use = 1; |
262 | 260 | ||
263 | ret = register_vpa(hwcpu, vpa); | 261 | addr = __pa(&lppaca[cpu]); |
262 | ret = register_vpa(hwcpu, addr); | ||
264 | 263 | ||
265 | if (ret) | 264 | if (ret) { |
266 | printk(KERN_ERR "WARNING: vpa_init: VPA registration for " | 265 | printk(KERN_ERR "WARNING: vpa_init: VPA registration for " |
267 | "cpu %d (hw %d) of area %lx returns %ld\n", | 266 | "cpu %d (hw %d) of area %lx returns %ld\n", |
268 | 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 | } | ||
269 | } | 283 | } |
270 | 284 | ||
271 | long pSeries_lpar_hpte_insert(unsigned long hpte_group, | 285 | long pSeries_lpar_hpte_insert(unsigned long hpte_group, |
@@ -277,7 +291,6 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, | |||
277 | unsigned long flags; | 291 | unsigned long flags; |
278 | unsigned long slot; | 292 | unsigned long slot; |
279 | unsigned long hpte_v, hpte_r; | 293 | unsigned long hpte_v, hpte_r; |
280 | unsigned long dummy0, dummy1; | ||
281 | 294 | ||
282 | if (!(vflags & HPTE_V_BOLTED)) | 295 | if (!(vflags & HPTE_V_BOLTED)) |
283 | DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, " | 296 | DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, " |
@@ -302,8 +315,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, | |||
302 | if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) | 315 | if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) |
303 | hpte_r &= ~_PAGE_COHERENT; | 316 | hpte_r &= ~_PAGE_COHERENT; |
304 | 317 | ||
305 | lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v, | 318 | lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); |
306 | hpte_r, &slot, &dummy0, &dummy1); | ||
307 | if (unlikely(lpar_rc == H_PTEG_FULL)) { | 319 | if (unlikely(lpar_rc == H_PTEG_FULL)) { |
308 | if (!(vflags & HPTE_V_BOLTED)) | 320 | if (!(vflags & HPTE_V_BOLTED)) |
309 | DBG_LOW(" full\n"); | 321 | DBG_LOW(" full\n"); |