powerpc/mm/hash64: use _PAGE_PTE when checking for pte_present
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Tue, 5 May 2020 07:17:10 +0000 (12:47 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 5 May 2020 11:20:14 +0000 (21:20 +1000)
commitec4abf1e70cf6a3fe6e571d640260005c997c6e1
tree462eec65473b6412610769f1c37e4efbf0f21b7d
parentc46241a370a61f0f264791abb9fc869016e749ce
powerpc/mm/hash64: use _PAGE_PTE when checking for pte_present

This makes the pte_present check stricter by checking for additional _PAGE_PTE
bit. A level 1 pte pointer (THP pte) can be switched to a pointer to level 0 pte
page table page by following two operations.

1) THP split.
2) madvise(MADV_DONTNEED) in parallel to page fault.

A lockless page table walk need to make sure we can handle such changes
gracefully.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200505071729.54912-4-aneesh.kumar@linux.ibm.com
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/mm/book3s64/hash_utils.c