path: root/include/linux/pgtable.h
diff options
authorChristophe Leroy <>2020-06-15 12:57:58 +0000
committerMichael Ellerman <>2020-06-20 22:14:53 +1000
commit481e980a7c199c5a4634fd7ea308067dd4ba75fa (patch)
tree8cb8ccaf80bd171a3745a034ac6647fc2865eeba /include/linux/pgtable.h
parent55ca22633a9faa34c6a61d99433f9cc8e28dd7cc (diff)
mm: Allow arches to provide ptep_get()
Since commit 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") it is not possible anymore to use READ_ONCE() to access complex page table entries like the one defined for powerpc 8xx with 16k size pages. Define a ptep_get() helper that architectures can override instead of performing a READ_ONCE() on the page table entry pointer. Fixes: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Signed-off-by: Christophe Leroy <> Acked-by: Will Deacon <> Acked-by: Peter Zijlstra (Intel) <> Signed-off-by: Michael Ellerman <> Link:
Diffstat (limited to 'include/linux/pgtable.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 32b6c52d41b9..56c1e8eb7bb0 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -249,6 +249,13 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
+static inline pte_t ptep_get(pte_t *ptep)
+ return READ_ONCE(*ptep);
static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,