Skip to contentSkip to conversation

powerpc/mm: Fix thread_pkey_regs_init()

PATCH Applied Ram Pai 3 participants 3 messages Mar 27, 2018 – Mar 31, 2018 PowerPC

lore
Share & tools
lore

Ram Pai

author
#0 lore raw

PATCH 1/1 powerpc/mm: Fix thread_pkey_regs_init()

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.

---
 arch/powerpc/mm/pkeys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/mm/pkeys.c +3 -3
index 58bbb55..61dba4e 100644
@@ -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)
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Ram Pai

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.

---

Balbir Singh

#2 lore raw
In reply to Ram Pai
Quoted 10 lines · Ram Pai

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.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f208638680e5cb4eb0d2871ce8c29a

cheers