]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: track allocation status of all pkeys
authorRam Pai <linuxram@us.ibm.com>
Fri, 19 Jan 2018 01:50:25 +0000 (17:50 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 20 Jan 2018 11:58:35 +0000 (22:58 +1100)
commitff3403724bc63a1cd10e6bb775cec2a95ebf3696
tree4ec2bfa69af9f93d48cedc54c2de08671c4a4c7d
parent0722c70dfd7d44b3cd10fc92ad1a7d947aa3cfa2
powerpc: track allocation status of all pkeys

Total 32 keys are available on power7 and above. However
pkey 0,1 are reserved. So effectively we  have  30 pkeys.

On 4K kernels, we do not  have  5  bits  in  the  PTE to
represent  all the keys; we only have 3bits. Two of those
keys are reserved; pkey 0 and pkey 1. So effectively  we
have 6 pkeys.

This patch keeps track of reserved keys, allocated  keys
and keys that are currently free.

Also it  adds  skeletal  functions  and macros, that the
architecture-independent code expects to be available.

Reviewed-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/mmu.h
arch/powerpc/include/asm/mmu_context.h
arch/powerpc/include/asm/pkeys.h
arch/powerpc/mm/mmu_context_book3s64.c
arch/powerpc/mm/pkeys.c