Skip to content

Commit

Permalink
powerpc: Finally remove _PAGE_USER
Browse files Browse the repository at this point in the history
_PAGE_USER is now gone on all targets. Remove it completely.

Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/76ebe74fdaed4297a1d8203a61174650c1d8d278.1695659959.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed Oct 19, 2023
1 parent ceaba66 commit 163a72f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions arch/powerpc/include/asm/nohash/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,14 @@ static inline int pte_young(pte_t pte)
}

/*
* Don't just check for any non zero bits in __PAGE_USER, since for book3e
* Don't just check for any non zero bits in __PAGE_READ, 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.
* _PAGE_READ. Need to explicitly match _PAGE_BAP_UR bit in that case too.
*/
#ifndef pte_read
static inline bool pte_read(pte_t pte)
{
#ifdef _PAGE_READ
return (pte_val(pte) & _PAGE_READ) == _PAGE_READ;
#else
return (pte_val(pte) & _PAGE_USER) == _PAGE_USER;
#endif
}
#endif

Expand All @@ -205,7 +201,7 @@ static inline bool pte_read(pte_t pte)
static inline bool pte_access_permitted(pte_t pte, bool write)
{
/*
* A read-only access is controlled by _PAGE_USER bit.
* A read-only access is controlled by _PAGE_READ bit.
* We have _PAGE_READ set for WRITE and EXECUTE
*/
if (!pte_present(pte) || !pte_read(pte))
Expand Down

0 comments on commit 163a72f

Please sign in to comment.