powerpc/mm: Add pte_xchg() helper
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 29 Apr 2016 13:25:27 +0000 (23:25 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 1 May 2016 08:32:16 +0000 (18:32 +1000)
commit3910a7f485e1222de2176ef5bf3a1d8de3152920
tree66de016468eb80717dbe0fc4a3d9b0081031b98c
parent4bece39b503c2340de154c82bf6d928e72d74d4e
powerpc/mm: Add pte_xchg() helper

We have five locations in 64-bit hash MMU code that do a cmpxchg() of a
PTE. Currently doing it inline OK, but in a future patch we will be
converting the PTEs to __be64 in some configs. In that case we will need
casts at every cmpxchg() site in order to keep sparse happy.

So move the logic into a helper, this is a reasonably nice cleanup on
its own.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/kvm_book3s_64.h
arch/powerpc/include/asm/pgtable-types.h
arch/powerpc/mm/hash64_4k.c
arch/powerpc/mm/hash64_64k.c
arch/powerpc/mm/hugetlbpage-hash64.c