|
@@ -51,6 +51,16 @@ static inline bool pte_hw_valid(pte_t pte)
|
|
|
return pte_val(pte) & _PAGE_PRESENT;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * Don't just check for any non zero bits in __PAGE_USER, since for book3e
|
|
|
+ * and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in
|
|
|
+ * _PAGE_USER. Need to explicitly match _PAGE_BAP_UR bit in that case too.
|
|
|
+ */
|
|
|
+static inline bool pte_user(pte_t pte)
|
|
|
+{
|
|
|
+ return (pte_val(pte) & (_PAGE_USER | _PAGE_PRIVILEGED)) == _PAGE_USER;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* We only find page table entry in the last level
|
|
|
* Hence no need for other accessors
|