* [PATCH] powerpc/mm: Fix thread_pkey_regs_init()
@ 2018-03-27 2:36 Ram Pai
2018-03-27 3:53 ` Balbir Singh
2018-03-31 14:04 ` Michael Ellerman
0 siblings, 2 replies; 3+ messages in thread
From: Ram Pai @ 2018-03-27 2:36 UTC (permalink / raw)
To: mpe
Cc: linuxppc-dev, benh, paulus, aneesh.kumar, bsingharora, hbabu,
mhocko, bauerman, linuxram, fweimer, msuchanek
thread_pkey_regs_init() initializes the pkey related registers
instead of initializing the fields in the task structures. Fortunately
those key related registers are re-set to zero when the task
gets scheduled on the cpu. However its good to fix this glaringly
visible error.
cc: Michael Ellermen <mpe@ellerman.id.au>
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
---
arch/powerpc/mm/pkeys.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c
index 58bbb55..61dba4e 100644
--- a/arch/powerpc/mm/pkeys.c
+++ b/arch/powerpc/mm/pkeys.c
@@ -338,9 +338,9 @@ void thread_pkey_regs_init(struct thread_struct *thread)
if (static_branch_likely(&pkey_disabled))
return;
- write_amr(read_amr() & pkey_amr_uamor_mask);
- write_iamr(read_iamr() & pkey_iamr_mask);
- write_uamor(read_uamor() & pkey_amr_uamor_mask);
+ thread->amr = read_amr() & pkey_amr_uamor_mask;
+ thread->iamr = read_iamr() & pkey_iamr_mask;
+ thread->uamor = read_uamor() & pkey_amr_uamor_mask;
}
static inline bool pkey_allows_readwrite(int pkey)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/mm: Fix thread_pkey_regs_init()
2018-03-27 2:36 [PATCH] powerpc/mm: Fix thread_pkey_regs_init() Ram Pai
@ 2018-03-27 3:53 ` Balbir Singh
2018-03-31 14:04 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Balbir Singh @ 2018-03-27 3:53 UTC (permalink / raw)
To: Ram Pai
Cc: Michael Ellerman, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT),
Benjamin Herrenschmidt, Paul Mackerras, Aneesh Kumar KV,
Haren Myneni/Beaverton/IBM, Michal Hocko, Thiago Jung Bauermann,
fweimer, msuchanek
On Tue, Mar 27, 2018 at 1:36 PM, Ram Pai <linuxram@us.ibm.com> wrote:
> thread_pkey_regs_init() initializes the pkey related registers
> instead of initializing the fields in the task structures. Fortunately
> those key related registers are re-set to zero when the task
> gets scheduled on the cpu. However its good to fix this glaringly
> visible error.
>
> cc: Michael Ellermen <mpe@ellerman.id.au>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
> ---
Acked-by: Balbir Singh <bsingharora@gmail.com>
Balbir Singh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: powerpc/mm: Fix thread_pkey_regs_init()
2018-03-27 2:36 [PATCH] powerpc/mm: Fix thread_pkey_regs_init() Ram Pai
2018-03-27 3:53 ` Balbir Singh
@ 2018-03-31 14:04 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Ram Pai
Cc: fweimer, msuchanek, linuxram, mhocko, paulus, aneesh.kumar,
bauerman, linuxppc-dev
On Tue, 2018-03-27 at 02:36:54 UTC, Ram Pai wrote:
> thread_pkey_regs_init() initializes the pkey related registers
> instead of initializing the fields in the task structures. Fortunately
> those key related registers are re-set to zero when the task
> gets scheduled on the cpu. However its good to fix this glaringly
> visible error.
>
> cc: Michael Ellermen <mpe@ellerman.id.au>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f208638680e5cb4eb0d2871ce8c29a
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-31 14:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-27 2:36 [PATCH] powerpc/mm: Fix thread_pkey_regs_init() Ram Pai
2018-03-27 3:53 ` Balbir Singh
2018-03-31 14:04 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).