mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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: 06bb53b338 ("powerpc: store and restore the pkey state across context switches")
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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
committed by
Michael Ellerman
parent
e6e133c47e
commit
f208638680
@@ -308,9 +308,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)
|
||||
|
||||
Reference in New Issue
Block a user