aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2013-06-20 05:00:13 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-21 02:01:52 -0400
commitdb3d8534903c8a9617142975bec6db95acaba753 (patch)
treeeea268dcfdd5cce84aa9b32025528dbc2d71d5aa /arch
parent8998897b8f966c9036307b5130494d4bf1e6cb18 (diff)
powerpc/mm: handle hugepage size correctly when invalidating hpte entries
If a hash bucket gets full, we "evict" a more/less random entry from it. When we do that we don't invalidate the TLB (hpte_remove) because we assume the old translation is still technically "valid". This implies that when we are invalidating or updating pte, even if HPTE entry is not valid we should do a tlb invalidate. With hugepages, we need to pass the correct actual page size value for tlb invalidation. This change update the patch 0608d692463598c1d6e826d9dd7283381b4f246c "powerpc/mm: Always invalidate tlb on hpte invalidate and update" to handle transparent hugepages correctly. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/machdep.h8
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_host.c2
-rw-r--r--arch/powerpc/mm/hash_low_64.S21
-rw-r--r--arch/powerpc/mm/hash_native_64.c122
-rw-r--r--arch/powerpc/mm/hash_utils_64.c9
-rw-r--r--arch/powerpc/mm/hugetlbpage-hash64.c2
-rw-r--r--arch/powerpc/platforms/cell/beat_htab.c16
-rw-r--r--arch/powerpc/platforms/ps3/htab.c5
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c17
9 files changed, 95 insertions, 107 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 92386fc4e82a..801e3c61395f 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -36,13 +36,13 @@ struct machdep_calls {
36#ifdef CONFIG_PPC64 36#ifdef CONFIG_PPC64
37 void (*hpte_invalidate)(unsigned long slot, 37 void (*hpte_invalidate)(unsigned long slot,
38 unsigned long vpn, 38 unsigned long vpn,
39 int psize, int ssize, 39 int bpsize, int apsize,
40 int local); 40 int ssize, int local);
41 long (*hpte_updatepp)(unsigned long slot, 41 long (*hpte_updatepp)(unsigned long slot,
42 unsigned long newpp, 42 unsigned long newpp,
43 unsigned long vpn, 43 unsigned long vpn,
44 int psize, int ssize, 44 int bpsize, int apsize,
45 int local); 45 int ssize, int local);
46 void (*hpte_updateboltedpp)(unsigned long newpp, 46 void (*hpte_updateboltedpp)(unsigned long newpp,
47 unsigned long ea, 47 unsigned long ea,
48 int psize, int ssize); 48 int psize, int ssize);
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index 3a9a1aceb14f..176d3fd53b73 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -34,7 +34,7 @@
34void kvmppc_mmu_invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte) 34void kvmppc_mmu_invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
35{ 35{
36 ppc_md.hpte_invalidate(pte->slot, pte->host_vpn, 36 ppc_md.hpte_invalidate(pte->slot, pte->host_vpn,
37 MMU_PAGE_4K, MMU_SEGSIZE_256M, 37 MMU_PAGE_4K, MMU_PAGE_4K, MMU_SEGSIZE_256M,
38 false); 38 false);
39} 39}
40 40
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S
index 0e980acae67c..d3cbda62857b 100644
--- a/arch/powerpc/mm/hash_low_64.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -289,9 +289,10 @@ htab_modify_pte:
289 289
290 /* Call ppc_md.hpte_updatepp */ 290 /* Call ppc_md.hpte_updatepp */
291 mr r5,r29 /* vpn */ 291 mr r5,r29 /* vpn */
292 li r6,MMU_PAGE_4K /* page size */ 292 li r6,MMU_PAGE_4K /* base page size */
293 ld r7,STK_PARAM(R9)(r1) /* segment size */ 293 li r7,MMU_PAGE_4K /* actual page size */
294 ld r8,STK_PARAM(R8)(r1) /* get "local" param */ 294 ld r8,STK_PARAM(R9)(r1) /* segment size */
295 ld r9,STK_PARAM(R8)(r1) /* get "local" param */
295_GLOBAL(htab_call_hpte_updatepp) 296_GLOBAL(htab_call_hpte_updatepp)
296 bl . /* Patched by htab_finish_init() */ 297 bl . /* Patched by htab_finish_init() */
297 298
@@ -649,9 +650,10 @@ htab_modify_pte:
649 650
650 /* Call ppc_md.hpte_updatepp */ 651 /* Call ppc_md.hpte_updatepp */
651 mr r5,r29 /* vpn */ 652 mr r5,r29 /* vpn */
652 li r6,MMU_PAGE_4K /* page size */ 653 li r6,MMU_PAGE_4K /* base page size */
653 ld r7,STK_PARAM(R9)(r1) /* segment size */ 654 li r7,MMU_PAGE_4K /* actual page size */
654 ld r8,STK_PARAM(R8)(r1) /* get "local" param */ 655 ld r8,STK_PARAM(R9)(r1) /* segment size */
656 ld r9,STK_PARAM(R8)(r1) /* get "local" param */
655_GLOBAL(htab_call_hpte_updatepp) 657_GLOBAL(htab_call_hpte_updatepp)
656 bl . /* patched by htab_finish_init() */ 658 bl . /* patched by htab_finish_init() */
657 659
@@ -937,9 +939,10 @@ ht64_modify_pte:
937 939
938 /* Call ppc_md.hpte_updatepp */ 940 /* Call ppc_md.hpte_updatepp */
939 mr r5,r29 /* vpn */ 941 mr r5,r29 /* vpn */
940 li r6,MMU_PAGE_64K 942 li r6,MMU_PAGE_64K /* base page size */
941 ld r7,STK_PARAM(R9)(r1) /* segment size */ 943 li r7,MMU_PAGE_64K /* actual page size */
942 ld r8,STK_PARAM(R8)(r1) /* get "local" param */ 944 ld r8,STK_PARAM(R9)(r1) /* segment size */
945 ld r9,STK_PARAM(R8)(r1) /* get "local" param */
943_GLOBAL(ht64_call_hpte_updatepp) 946_GLOBAL(ht64_call_hpte_updatepp)
944 bl . /* patched by htab_finish_init() */ 947 bl . /* patched by htab_finish_init() */
945 948
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 4c122c3f1623..6d152bc993e5 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -273,61 +273,15 @@ static long native_hpte_remove(unsigned long hpte_group)
273 return i; 273 return i;
274} 274}
275 275
276static inline int __hpte_actual_psize(unsigned int lp, int psize)
277{
278 int i, shift;
279 unsigned int mask;
280
281 /* start from 1 ignoring MMU_PAGE_4K */
282 for (i = 1; i < MMU_PAGE_COUNT; i++) {
283
284 /* invalid penc */
285 if (mmu_psize_defs[psize].penc[i] == -1)
286 continue;
287 /*
288 * encoding bits per actual page size
289 * PTE LP actual page size
290 * rrrr rrrz >=8KB
291 * rrrr rrzz >=16KB
292 * rrrr rzzz >=32KB
293 * rrrr zzzz >=64KB
294 * .......
295 */
296 shift = mmu_psize_defs[i].shift - LP_SHIFT;
297 if (shift > LP_BITS)
298 shift = LP_BITS;
299 mask = (1 << shift) - 1;
300 if ((lp & mask) == mmu_psize_defs[psize].penc[i])
301 return i;
302 }
303 return -1;
304}
305
306static inline int hpte_actual_psize(struct hash_pte *hptep, int psize)
307{
308 /* Look at the 8 bit LP value */
309 unsigned int lp = (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1);
310
311 if (!(hptep->v & HPTE_V_VALID))
312 return -1;
313
314 /* First check if it is large page */
315 if (!(hptep->v & HPTE_V_LARGE))
316 return MMU_PAGE_4K;
317
318 return __hpte_actual_psize(lp, psize);
319}
320
321static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, 276static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
322 unsigned long vpn, int psize, int ssize, 277 unsigned long vpn, int bpsize,
323 int local) 278 int apsize, int ssize, int local)
324{ 279{
325 struct hash_pte *hptep = htab_address + slot; 280 struct hash_pte *hptep = htab_address + slot;
326 unsigned long hpte_v, want_v; 281 unsigned long hpte_v, want_v;
327 int ret = 0; 282 int ret = 0;
328 int actual_psize;
329 283
330 want_v = hpte_encode_avpn(vpn, psize, ssize); 284 want_v = hpte_encode_avpn(vpn, bpsize, ssize);
331 285
332 DBG_LOW(" update(vpn=%016lx, avpnv=%016lx, group=%lx, newpp=%lx)", 286 DBG_LOW(" update(vpn=%016lx, avpnv=%016lx, group=%lx, newpp=%lx)",
333 vpn, want_v & HPTE_V_AVPN, slot, newpp); 287 vpn, want_v & HPTE_V_AVPN, slot, newpp);
@@ -335,7 +289,6 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
335 native_lock_hpte(hptep); 289 native_lock_hpte(hptep);
336 290
337 hpte_v = hptep->v; 291 hpte_v = hptep->v;
338 actual_psize = hpte_actual_psize(hptep, psize);
339 /* 292 /*
340 * We need to invalidate the TLB always because hpte_remove doesn't do 293 * We need to invalidate the TLB always because hpte_remove doesn't do
341 * a tlb invalidate. If a hash bucket gets full, we "evict" a more/less 294 * a tlb invalidate. If a hash bucket gets full, we "evict" a more/less
@@ -343,12 +296,7 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
343 * (hpte_remove) because we assume the old translation is still 296 * (hpte_remove) because we assume the old translation is still
344 * technically "valid". 297 * technically "valid".
345 */ 298 */
346 if (actual_psize < 0) { 299 if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID)) {
347 actual_psize = psize;
348 ret = -1;
349 goto err_out;
350 }
351 if (!HPTE_V_COMPARE(hpte_v, want_v)) {
352 DBG_LOW(" -> miss\n"); 300 DBG_LOW(" -> miss\n");
353 ret = -1; 301 ret = -1;
354 } else { 302 } else {
@@ -357,11 +305,10 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
357 hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) | 305 hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
358 (newpp & (HPTE_R_PP | HPTE_R_N | HPTE_R_C)); 306 (newpp & (HPTE_R_PP | HPTE_R_N | HPTE_R_C));
359 } 307 }
360err_out:
361 native_unlock_hpte(hptep); 308 native_unlock_hpte(hptep);
362 309
363 /* Ensure it is out of the tlb too. */ 310 /* Ensure it is out of the tlb too. */
364 tlbie(vpn, psize, actual_psize, ssize, local); 311 tlbie(vpn, bpsize, apsize, ssize, local);
365 312
366 return ret; 313 return ret;
367} 314}
@@ -402,7 +349,6 @@ static long native_hpte_find(unsigned long vpn, int psize, int ssize)
402static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea, 349static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
403 int psize, int ssize) 350 int psize, int ssize)
404{ 351{
405 int actual_psize;
406 unsigned long vpn; 352 unsigned long vpn;
407 unsigned long vsid; 353 unsigned long vsid;
408 long slot; 354 long slot;
@@ -415,36 +361,33 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
415 if (slot == -1) 361 if (slot == -1)
416 panic("could not find page to bolt\n"); 362 panic("could not find page to bolt\n");
417 hptep = htab_address + slot; 363 hptep = htab_address + slot;
418 actual_psize = hpte_actual_psize(hptep, psize);
419 if (actual_psize < 0)
420 actual_psize = psize;
421 364
422 /* Update the HPTE */ 365 /* Update the HPTE */
423 hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) | 366 hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
424 (newpp & (HPTE_R_PP | HPTE_R_N)); 367 (newpp & (HPTE_R_PP | HPTE_R_N));
425 368 /*
426 /* Ensure it is out of the tlb too. */ 369 * Ensure it is out of the tlb too. Bolted entries base and
427 tlbie(vpn, psize, actual_psize, ssize, 0); 370 * actual page size will be same.
371 */
372 tlbie(vpn, psize, psize, ssize, 0);
428} 373}
429 374
430static void native_hpte_invalidate(unsigned long slot, unsigned long vpn, 375static void native_hpte_invalidate(unsigned long slot, unsigned long vpn,
431 int psize, int ssize, int local) 376 int bpsize, int apsize, int ssize, int local)
432{ 377{
433 struct hash_pte *hptep = htab_address + slot; 378 struct hash_pte *hptep = htab_address + slot;
434 unsigned long hpte_v; 379 unsigned long hpte_v;
435 unsigned long want_v; 380 unsigned long want_v;
436 unsigned long flags; 381 unsigned long flags;
437 int actual_psize;
438 382
439 local_irq_save(flags); 383 local_irq_save(flags);
440 384
441 DBG_LOW(" invalidate(vpn=%016lx, hash: %lx)\n", vpn, slot); 385 DBG_LOW(" invalidate(vpn=%016lx, hash: %lx)\n", vpn, slot);
442 386
443 want_v = hpte_encode_avpn(vpn, psize, ssize); 387 want_v = hpte_encode_avpn(vpn, bpsize, ssize);
444 native_lock_hpte(hptep); 388 native_lock_hpte(hptep);
445 hpte_v = hptep->v; 389 hpte_v = hptep->v;
446 390
447 actual_psize = hpte_actual_psize(hptep, psize);
448 /* 391 /*
449 * We need to invalidate the TLB always because hpte_remove doesn't do 392 * We need to invalidate the TLB always because hpte_remove doesn't do
450 * a tlb invalidate. If a hash bucket gets full, we "evict" a more/less 393 * a tlb invalidate. If a hash bucket gets full, we "evict" a more/less
@@ -452,23 +395,48 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long vpn,
452 * (hpte_remove) because we assume the old translation is still 395 * (hpte_remove) because we assume the old translation is still
453 * technically "valid". 396 * technically "valid".
454 */ 397 */
455 if (actual_psize < 0) { 398 if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID))
456 actual_psize = psize;
457 native_unlock_hpte(hptep);
458 goto err_out;
459 }
460 if (!HPTE_V_COMPARE(hpte_v, want_v))
461 native_unlock_hpte(hptep); 399 native_unlock_hpte(hptep);
462 else 400 else
463 /* Invalidate the hpte. NOTE: this also unlocks it */ 401 /* Invalidate the hpte. NOTE: this also unlocks it */
464 hptep->v = 0; 402 hptep->v = 0;
465 403
466err_out:
467 /* Invalidate the TLB */ 404 /* Invalidate the TLB */
468 tlbie(vpn, psize, actual_psize, ssize, local); 405 tlbie(vpn, bpsize, apsize, ssize, local);
406
469 local_irq_restore(flags); 407 local_irq_restore(flags);
470} 408}
471 409
410static inline int __hpte_actual_psize(unsigned int lp, int psize)
411{
412 int i, shift;
413 unsigned int mask;
414
415 /* start from 1 ignoring MMU_PAGE_4K */
416 for (i = 1; i < MMU_PAGE_COUNT; i++) {
417
418 /* invalid penc */
419 if (mmu_psize_defs[psize].penc[i] == -1)
420 continue;
421 /*
422 * encoding bits per actual page size
423 * PTE LP actual page size
424 * rrrr rrrz >=8KB
425 * rrrr rrzz >=16KB
426 * rrrr rzzz >=32KB
427 * rrrr zzzz >=64KB
428 * .......
429 */
430 shift = mmu_psize_defs[i].shift - LP_SHIFT;
431 if (shift > LP_BITS)
432 shift = LP_BITS;
433 mask = (1 << shift) - 1;
434 if ((lp & mask) == mmu_psize_defs[psize].penc[i])
435 return i;
436 }
437 return -1;
438}
439
472static void hpte_decode(struct hash_pte *hpte, unsigned long slot, 440static void hpte_decode(struct hash_pte *hpte, unsigned long slot,
473 int *psize, int *apsize, int *ssize, unsigned long *vpn) 441 int *psize, int *apsize, int *ssize, unsigned long *vpn)
474{ 442{
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index e303a6d74e3a..2f470809876f 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1232,7 +1232,11 @@ void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
1232 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 1232 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
1233 slot += hidx & _PTEIDX_GROUP_IX; 1233 slot += hidx & _PTEIDX_GROUP_IX;
1234 DBG_LOW(" sub %ld: hash=%lx, hidx=%lx\n", index, slot, hidx); 1234 DBG_LOW(" sub %ld: hash=%lx, hidx=%lx\n", index, slot, hidx);
1235 ppc_md.hpte_invalidate(slot, vpn, psize, ssize, local); 1235 /*
1236 * We use same base page size and actual psize, because we don't
1237 * use these functions for hugepage
1238 */
1239 ppc_md.hpte_invalidate(slot, vpn, psize, psize, ssize, local);
1236 } pte_iterate_hashed_end(); 1240 } pte_iterate_hashed_end();
1237 1241
1238#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1242#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
@@ -1365,7 +1369,8 @@ static void kernel_unmap_linear_page(unsigned long vaddr, unsigned long lmi)
1365 hash = ~hash; 1369 hash = ~hash;
1366 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 1370 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
1367 slot += hidx & _PTEIDX_GROUP_IX; 1371 slot += hidx & _PTEIDX_GROUP_IX;
1368 ppc_md.hpte_invalidate(slot, vpn, mmu_linear_psize, mmu_kernel_ssize, 0); 1372 ppc_md.hpte_invalidate(slot, vpn, mmu_linear_psize, mmu_linear_psize,
1373 mmu_kernel_ssize, 0);
1369} 1374}
1370 1375
1371void kernel_map_pages(struct page *page, int numpages, int enable) 1376void kernel_map_pages(struct page *page, int numpages, int enable)
diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c
index 0f1d94a1fb82..0b7fb6761015 100644
--- a/arch/powerpc/mm/hugetlbpage-hash64.c
+++ b/arch/powerpc/mm/hugetlbpage-hash64.c
@@ -81,7 +81,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
81 slot += (old_pte & _PAGE_F_GIX) >> 12; 81 slot += (old_pte & _PAGE_F_GIX) >> 12;
82 82
83 if (ppc_md.hpte_updatepp(slot, rflags, vpn, mmu_psize, 83 if (ppc_md.hpte_updatepp(slot, rflags, vpn, mmu_psize,
84 ssize, local) == -1) 84 mmu_psize, ssize, local) == -1)
85 old_pte &= ~_PAGE_HPTEFLAGS; 85 old_pte &= ~_PAGE_HPTEFLAGS;
86 } 86 }
87 87
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c
index 246e1d8b3af3..c34ee4e60873 100644
--- a/arch/powerpc/platforms/cell/beat_htab.c
+++ b/arch/powerpc/platforms/cell/beat_htab.c
@@ -185,7 +185,8 @@ static void beat_lpar_hptab_clear(void)
185static long beat_lpar_hpte_updatepp(unsigned long slot, 185static long beat_lpar_hpte_updatepp(unsigned long slot,
186 unsigned long newpp, 186 unsigned long newpp,
187 unsigned long vpn, 187 unsigned long vpn,
188 int psize, int ssize, int local) 188 int psize, int apsize,
189 int ssize, int local)
189{ 190{
190 unsigned long lpar_rc; 191 unsigned long lpar_rc;
191 u64 dummy0, dummy1; 192 u64 dummy0, dummy1;
@@ -274,7 +275,8 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
274} 275}
275 276
276static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn, 277static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn,
277 int psize, int ssize, int local) 278 int psize, int apsize,
279 int ssize, int local)
278{ 280{
279 unsigned long want_v; 281 unsigned long want_v;
280 unsigned long lpar_rc; 282 unsigned long lpar_rc;
@@ -364,9 +366,10 @@ static long beat_lpar_hpte_insert_v3(unsigned long hpte_group,
364 * already zero. For now I am paranoid. 366 * already zero. For now I am paranoid.
365 */ 367 */
366static long beat_lpar_hpte_updatepp_v3(unsigned long slot, 368static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
367 unsigned long newpp, 369 unsigned long newpp,
368 unsigned long vpn, 370 unsigned long vpn,
369 int psize, int ssize, int local) 371 int psize, int apsize,
372 int ssize, int local)
370{ 373{
371 unsigned long lpar_rc; 374 unsigned long lpar_rc;
372 unsigned long want_v; 375 unsigned long want_v;
@@ -394,7 +397,8 @@ static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
394} 397}
395 398
396static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long vpn, 399static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long vpn,
397 int psize, int ssize, int local) 400 int psize, int apsize,
401 int ssize, int local)
398{ 402{
399 unsigned long want_v; 403 unsigned long want_v;
400 unsigned long lpar_rc; 404 unsigned long lpar_rc;
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c
index 177a2f70700c..3e270e3412ae 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -109,7 +109,8 @@ static long ps3_hpte_remove(unsigned long hpte_group)
109} 109}
110 110
111static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp, 111static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
112 unsigned long vpn, int psize, int ssize, int local) 112 unsigned long vpn, int psize, int apsize,
113 int ssize, int local)
113{ 114{
114 int result; 115 int result;
115 u64 hpte_v, want_v, hpte_rs; 116 u64 hpte_v, want_v, hpte_rs;
@@ -162,7 +163,7 @@ static void ps3_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
162} 163}
163 164
164static void ps3_hpte_invalidate(unsigned long slot, unsigned long vpn, 165static void ps3_hpte_invalidate(unsigned long slot, unsigned long vpn,
165 int psize, int ssize, int local) 166 int psize, int apsize, int ssize, int local)
166{ 167{
167 unsigned long flags; 168 unsigned long flags;
168 int result; 169 int result;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 6d62072a7d5a..ca45c8f3c0ba 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -240,7 +240,8 @@ static void pSeries_lpar_hptab_clear(void)
240static long pSeries_lpar_hpte_updatepp(unsigned long slot, 240static long pSeries_lpar_hpte_updatepp(unsigned long slot,
241 unsigned long newpp, 241 unsigned long newpp,
242 unsigned long vpn, 242 unsigned long vpn,
243 int psize, int ssize, int local) 243 int psize, int apsize,
244 int ssize, int local)
244{ 245{
245 unsigned long lpar_rc; 246 unsigned long lpar_rc;
246 unsigned long flags = (newpp & 7) | H_AVPN; 247 unsigned long flags = (newpp & 7) | H_AVPN;
@@ -328,7 +329,8 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
328} 329}
329 330
330static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn, 331static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn,
331 int psize, int ssize, int local) 332 int psize, int apsize,
333 int ssize, int local)
332{ 334{
333 unsigned long want_v; 335 unsigned long want_v;
334 unsigned long lpar_rc; 336 unsigned long lpar_rc;
@@ -356,8 +358,10 @@ static void pSeries_lpar_hpte_removebolted(unsigned long ea,
356 358
357 slot = pSeries_lpar_hpte_find(vpn, psize, ssize); 359 slot = pSeries_lpar_hpte_find(vpn, psize, ssize);
358 BUG_ON(slot == -1); 360 BUG_ON(slot == -1);
359 361 /*
360 pSeries_lpar_hpte_invalidate(slot, vpn, psize, ssize, 0); 362 * lpar doesn't use the passed actual page size
363 */
364 pSeries_lpar_hpte_invalidate(slot, vpn, psize, 0, ssize, 0);
361} 365}
362 366
363/* Flag bits for H_BULK_REMOVE */ 367/* Flag bits for H_BULK_REMOVE */
@@ -400,8 +404,11 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
400 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 404 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
401 slot += hidx & _PTEIDX_GROUP_IX; 405 slot += hidx & _PTEIDX_GROUP_IX;
402 if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) { 406 if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) {
407 /*
408 * lpar doesn't use the passed actual page size
409 */
403 pSeries_lpar_hpte_invalidate(slot, vpn, psize, 410 pSeries_lpar_hpte_invalidate(slot, vpn, psize,
404 ssize, local); 411 0, ssize, local);
405 } else { 412 } else {
406 param[pix] = HBR_REQUEST | HBR_AVPN | slot; 413 param[pix] = HBR_REQUEST | HBR_AVPN | slot;
407 param[pix+1] = hpte_encode_avpn(vpn, psize, 414 param[pix+1] = hpte_encode_avpn(vpn, psize,