Skip to content

Commit f208638

Browse files
Ram Paimpe
authored andcommitted
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. Fixes: 06bb53b ("powerpc: store and restore the pkey state across context switches") Signed-off-by: Ram Pai <[email protected]> Signed-off-by: Thiago Jung Bauermann <[email protected]> Acked-by: Balbir Singh <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent e6e133c commit f208638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/powerpc/mm/pkeys.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ void thread_pkey_regs_init(struct thread_struct *thread)
308308
if (static_branch_likely(&pkey_disabled))
309309
return;
310310

311-
write_amr(read_amr() & pkey_amr_uamor_mask);
312-
write_iamr(read_iamr() & pkey_iamr_mask);
313-
write_uamor(read_uamor() & pkey_amr_uamor_mask);
311+
thread->amr = read_amr() & pkey_amr_uamor_mask;
312+
thread->iamr = read_iamr() & pkey_iamr_mask;
313+
thread->uamor = read_uamor() & pkey_amr_uamor_mask;
314314
}
315315

316316
static inline bool pkey_allows_readwrite(int pkey)

0 commit comments

Comments
 (0)