diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2013-04-28 05:37:34 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-04-30 02:00:11 -0400 |
commit | 74f227b22897e0db52a58f8f634e9ce6f67cc652 (patch) | |
tree | 987b31602251010b3335389510cf5d037d331413 /arch | |
parent | 5c1f6ee9a31cbdac90bbb8ae1ba4475031ac74b4 (diff) |
powerpc: Use encode avpn where we need only avpn values
In all these cases we are doing something similar to
HPTE_V_COMPARE(hpte_v, want_v) which ignores the HPTE_V_LARGE bit
With MPSS support we would need actual page size to set HPTE_V_LARGE
bit and that won't be available in most of these cases. Since we are ignoring
HPTE_V_LARGE bit, use the avpn value instead. There should not be any change
in behaviour after this patch.
Acked-by: Paul Mackerras <paulus@samba.org>
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/mm/hash_native_64.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/beat_htab.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/htab.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c index ffc1e00f7a22..9d8983ad1dec 100644 --- a/arch/powerpc/mm/hash_native_64.c +++ b/arch/powerpc/mm/hash_native_64.c | |||
@@ -252,7 +252,7 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, | |||
252 | unsigned long hpte_v, want_v; | 252 | unsigned long hpte_v, want_v; |
253 | int ret = 0; | 253 | int ret = 0; |
254 | 254 | ||
255 | want_v = hpte_encode_v(vpn, psize, ssize); | 255 | want_v = hpte_encode_avpn(vpn, psize, ssize); |
256 | 256 | ||
257 | DBG_LOW(" update(vpn=%016lx, avpnv=%016lx, group=%lx, newpp=%lx)", | 257 | DBG_LOW(" update(vpn=%016lx, avpnv=%016lx, group=%lx, newpp=%lx)", |
258 | vpn, want_v & HPTE_V_AVPN, slot, newpp); | 258 | vpn, want_v & HPTE_V_AVPN, slot, newpp); |
@@ -288,7 +288,7 @@ static long native_hpte_find(unsigned long vpn, int psize, int ssize) | |||
288 | unsigned long want_v, hpte_v; | 288 | unsigned long want_v, hpte_v; |
289 | 289 | ||
290 | hash = hpt_hash(vpn, mmu_psize_defs[psize].shift, ssize); | 290 | hash = hpt_hash(vpn, mmu_psize_defs[psize].shift, ssize); |
291 | want_v = hpte_encode_v(vpn, psize, ssize); | 291 | want_v = hpte_encode_avpn(vpn, psize, ssize); |
292 | 292 | ||
293 | /* Bolted mappings are only ever in the primary group */ | 293 | /* Bolted mappings are only ever in the primary group */ |
294 | slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; | 294 | slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; |
@@ -348,7 +348,7 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long vpn, | |||
348 | 348 | ||
349 | DBG_LOW(" invalidate(vpn=%016lx, hash: %lx)\n", vpn, slot); | 349 | DBG_LOW(" invalidate(vpn=%016lx, hash: %lx)\n", vpn, slot); |
350 | 350 | ||
351 | want_v = hpte_encode_v(vpn, psize, ssize); | 351 | want_v = hpte_encode_avpn(vpn, psize, ssize); |
352 | native_lock_hpte(hptep); | 352 | native_lock_hpte(hptep); |
353 | hpte_v = hptep->v; | 353 | hpte_v = hptep->v; |
354 | 354 | ||
@@ -520,7 +520,7 @@ static void native_flush_hash_range(unsigned long number, int local) | |||
520 | slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; | 520 | slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; |
521 | slot += hidx & _PTEIDX_GROUP_IX; | 521 | slot += hidx & _PTEIDX_GROUP_IX; |
522 | hptep = htab_address + slot; | 522 | hptep = htab_address + slot; |
523 | want_v = hpte_encode_v(vpn, psize, ssize); | 523 | want_v = hpte_encode_avpn(vpn, psize, ssize); |
524 | native_lock_hpte(hptep); | 524 | native_lock_hpte(hptep); |
525 | hpte_v = hptep->v; | 525 | hpte_v = hptep->v; |
526 | if (!HPTE_V_COMPARE(hpte_v, want_v) || | 526 | if (!HPTE_V_COMPARE(hpte_v, want_v) || |
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c index 0f6f83988b3d..472f9a7609cf 100644 --- a/arch/powerpc/platforms/cell/beat_htab.c +++ b/arch/powerpc/platforms/cell/beat_htab.c | |||
@@ -191,7 +191,7 @@ static long beat_lpar_hpte_updatepp(unsigned long slot, | |||
191 | u64 dummy0, dummy1; | 191 | u64 dummy0, dummy1; |
192 | unsigned long want_v; | 192 | unsigned long want_v; |
193 | 193 | ||
194 | want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M); | 194 | want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M); |
195 | 195 | ||
196 | DBG_LOW(" update: " | 196 | DBG_LOW(" update: " |
197 | "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", | 197 | "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", |
@@ -228,7 +228,7 @@ static long beat_lpar_hpte_find(unsigned long vpn, int psize) | |||
228 | unsigned long want_v, hpte_v; | 228 | unsigned long want_v, hpte_v; |
229 | 229 | ||
230 | hash = hpt_hash(vpn, mmu_psize_defs[psize].shift, MMU_SEGSIZE_256M); | 230 | hash = hpt_hash(vpn, mmu_psize_defs[psize].shift, MMU_SEGSIZE_256M); |
231 | want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M); | 231 | want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M); |
232 | 232 | ||
233 | for (j = 0; j < 2; j++) { | 233 | for (j = 0; j < 2; j++) { |
234 | slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; | 234 | slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; |
@@ -283,7 +283,7 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn, | |||
283 | 283 | ||
284 | DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", | 284 | DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", |
285 | slot, va, psize, local); | 285 | slot, va, psize, local); |
286 | want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M); | 286 | want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M); |
287 | 287 | ||
288 | raw_spin_lock_irqsave(&beat_htab_lock, flags); | 288 | raw_spin_lock_irqsave(&beat_htab_lock, flags); |
289 | dummy1 = beat_lpar_hpte_getword0(slot); | 289 | dummy1 = beat_lpar_hpte_getword0(slot); |
@@ -372,7 +372,7 @@ static long beat_lpar_hpte_updatepp_v3(unsigned long slot, | |||
372 | unsigned long want_v; | 372 | unsigned long want_v; |
373 | unsigned long pss; | 373 | unsigned long pss; |
374 | 374 | ||
375 | want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M); | 375 | want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M); |
376 | pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc; | 376 | pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc; |
377 | 377 | ||
378 | DBG_LOW(" update: " | 378 | DBG_LOW(" update: " |
@@ -402,7 +402,7 @@ static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long vpn, | |||
402 | 402 | ||
403 | DBG_LOW(" inval : slot=%lx, vpn=%016lx, psize: %d, local: %d\n", | 403 | DBG_LOW(" inval : slot=%lx, vpn=%016lx, psize: %d, local: %d\n", |
404 | slot, vpn, psize, local); | 404 | slot, vpn, psize, local); |
405 | want_v = hpte_encode_v(vpn, psize, MMU_SEGSIZE_256M); | 405 | want_v = hpte_encode_avpn(vpn, psize, MMU_SEGSIZE_256M); |
406 | pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc; | 406 | pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc; |
407 | 407 | ||
408 | lpar_rc = beat_invalidate_htab_entry3(0, slot, want_v, pss); | 408 | lpar_rc = beat_invalidate_htab_entry3(0, slot, want_v, pss); |
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c index 6cc58201db8c..cd8f2fbb6d1a 100644 --- a/arch/powerpc/platforms/ps3/htab.c +++ b/arch/powerpc/platforms/ps3/htab.c | |||
@@ -117,7 +117,7 @@ static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp, | |||
117 | unsigned long flags; | 117 | unsigned long flags; |
118 | long ret; | 118 | long ret; |
119 | 119 | ||
120 | want_v = hpte_encode_v(vpn, psize, ssize); | 120 | want_v = hpte_encode_avpn(vpn, psize, ssize); |
121 | 121 | ||
122 | spin_lock_irqsave(&ps3_htab_lock, flags); | 122 | spin_lock_irqsave(&ps3_htab_lock, flags); |
123 | 123 | ||