powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Thu, 20 Sep 2018 18:09:42 +0000 (23:39 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 3 Oct 2018 05:39:58 +0000 (15:39 +1000)
commitda7ad366b497f5fc1d4a416f168057ba40bddb98
tree2d8a123162eb61a0adbac9a0b16c6664c429611e
parent8139046a5a34787849df81f4a5875cf4b404a7a1
powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit

With this patch we use 0x8000000000000000UL (_PAGE_PRESENT) to indicate a valid
pgd/pud/pmd entry. We also switch the p**_present() to look at this bit.

With pmd_present, we have a special case. We need to make sure we consider a
pmd marked invalid during THP split as present. Right now we clear the
_PAGE_PRESENT bit during a pmdp_invalidate. Inorder to consider this special
case we add a new pte bit _PAGE_INVALID (mapped to _RPAGE_SW0). This bit is
only used with _PAGE_PRESENT cleared. Hence we are not really losing a pte bit
for this special case. pmd_present is also updated to look at _PAGE_INVALID.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/hash.h
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/pgtable-book3s64.c
arch/powerpc/mm/pgtable.c