diff options
author | Andrey Zhizhikin <andrey.z@gmail.com> | 2020-08-11 08:29:45 +0000 |
---|---|---|
committer | Andrey Zhizhikin <andrey.z@gmail.com> | 2020-08-11 08:29:45 +0000 |
commit | 14eec8a71c3e212080803c50cd9d7982e8208ec5 (patch) | |
tree | ad0bcaf840c4999bc7b6a0291116eaa57db2a103 /arch/powerpc/mm | |
parent | 7da1a123ebce2005573def510c61214fc1000163 (diff) | |
parent | d811d29517d1ea05bc159579231652d3ca1c2a01 (diff) |
Merge tag 'v5.4.53' into 5.4-2.1.x-imx
This is the 5.4.53 stable release
Conflicts (manual resolve, upstream patch merged):
drivers/thermal/imx_thermal.c
Upstream patch [9025a5589c035a7328c920ed4e190c0c2f5d017d] adds missing
of_node_put call, NXP version has been adapted to accommodate this patch
into the code.
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/book3s64/pkeys.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index ae7fca40e5b3..66f307e873dc 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/arch/powerpc/mm/book3s64/pkeys.c @@ -367,12 +367,14 @@ static bool pkey_access_permitted(int pkey, bool write, bool execute) return true; pkey_shift = pkeyshift(pkey); - if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift))) - return true; + if (execute) + return !(read_iamr() & (IAMR_EX_BIT << pkey_shift)); + + amr = read_amr(); + if (write) + return !(amr & (AMR_WR_BIT << pkey_shift)); - amr = read_amr(); /* Delay reading amr until absolutely needed */ - return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) || - (write && !(amr & (AMR_WR_BIT << pkey_shift)))); + return !(amr & (AMR_RD_BIT << pkey_shift)); } bool arch_pte_access_permitted(u64 pte, bool write, bool execute) |