OSDN Git Service

powerpc/book3s64/kuap: Use Key 3 for kernel mapping with hash translation
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Fri, 27 Nov 2020 04:44:10 +0000 (10:14 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 Dec 2020 14:01:25 +0000 (01:01 +1100)
commitd94b827e89dc3f92cd871d10f4992a6bd3c861e5
treecf3fd6317c4c6b93f539381c2bd0d081f272b88c
parentd5b810b5c938e73fd21b2b05ef6a79837eeaa305
powerpc/book3s64/kuap: Use Key 3 for kernel mapping with hash translation

This patch updates kernel hash page table entries to use storage key 3
for its mapping. This implies all kernel access will now use key 3 to
control READ/WRITE. The patch also prevents the allocation of key 3 from
userspace and UAMOR value is updated such that userspace cannot modify key 3.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201127044424.40686-9-aneesh.kumar@linux.ibm.com
arch/powerpc/include/asm/book3s/64/hash-pkey.h
arch/powerpc/include/asm/book3s/64/hash.h
arch/powerpc/include/asm/book3s/64/mmu-hash.h
arch/powerpc/include/asm/mmu_context.h
arch/powerpc/mm/book3s64/hash_4k.c
arch/powerpc/mm/book3s64/hash_64k.c
arch/powerpc/mm/book3s64/hash_hugepage.c
arch/powerpc/mm/book3s64/hash_hugetlbpage.c
arch/powerpc/mm/book3s64/hash_pgtable.c
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/mm/book3s64/pkeys.c