UAMOR values are not application-specific. The kernel initializes
its value based on different reserved keys. Remove the thread-specific
UAMOR value and don't switch the UAMOR on context switch.
Move UAMOR initialization to key initialization code and remove
thread_struct.uamor because it is not used anymore.
Before commit: 4a4a5e5d2a ("powerpc/pkeys: key allocation/deallocation must not change pkey registers")
we used to update uamor based on key allocation and free.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200709032946.881753-20-aneesh.kumar@linux.ibm.com
28 lines
555 B
C
28 lines
555 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#ifndef _ASM_POWERPC_BOOK3S_64_PKEYS_H
|
|
#define _ASM_POWERPC_BOOK3S_64_PKEYS_H
|
|
|
|
#include <asm/book3s/64/hash-pkey.h>
|
|
|
|
extern u64 __ro_after_init default_uamor;
|
|
|
|
static inline u64 vmflag_to_pte_pkey_bits(u64 vm_flags)
|
|
{
|
|
if (!mmu_has_feature(MMU_FTR_PKEY))
|
|
return 0x0UL;
|
|
|
|
if (radix_enabled())
|
|
BUG();
|
|
return hash__vmflag_to_pte_pkey_bits(vm_flags);
|
|
}
|
|
|
|
static inline u16 pte_to_pkey_bits(u64 pteflags)
|
|
{
|
|
if (radix_enabled())
|
|
BUG();
|
|
return hash__pte_to_pkey_bits(pteflags);
|
|
}
|
|
|
|
#endif /*_ASM_POWERPC_KEYS_H */
|