Re: [RFC v5 00/38] powerpc: Memory Protection Keys

2017-07-09 Thread Ram Pai
On Mon, Jul 10, 2017 at 11:13:23AM +0530, Anshuman Khandual wrote: > On 07/06/2017 02:51 AM, Ram Pai wrote: > > Memory protection keys enable applications to protect its > > address space from inadvertent access or corruption from > > itself. > > > > The overall idea: > > > > A process allocates

Re: [RFC v5 34/38] procfs: display the protection-key number associated with a vma

2017-07-09 Thread Ram Pai
On Mon, Jul 10, 2017 at 08:37:28AM +0530, Anshuman Khandual wrote: > On 07/06/2017 02:52 AM, Ram Pai wrote: > > Display the pkey number associated with the vma in smaps of a task. > > The key will be seen as below: > > > > ProtectionKey: 0 > > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc

Re: [RFC v5 38/38] Documentation: PowerPC specific updates to memory protection keys

2017-07-09 Thread Ram Pai
On Mon, Jul 10, 2017 at 08:37:04AM +0530, Anshuman Khandual wrote: > On 07/06/2017 02:52 AM, Ram Pai wrote: > > Add documentation updates that capture PowerPC specific changes. > > > > Signed-off-by: Ram Pai > > --- > > Documentation/vm/protection-keys.txt | 85 > > ++-

Re: [RFC v5 31/38] powerpc: introduce get_pte_pkey() helper

2017-07-09 Thread Ram Pai
On Mon, Jul 10, 2017 at 08:41:30AM +0530, Anshuman Khandual wrote: > On 07/06/2017 02:52 AM, Ram Pai wrote: > > get_pte_pkey() helper returns the pkey associated with > > a address corresponding to a given mm_struct. > > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/include/asm/book3s/64/m

Re: [RFC v5 32/38] powerpc: capture the violated protection key on fault

2017-07-09 Thread Ram Pai
On Mon, Jul 10, 2017 at 08:40:19AM +0530, Anshuman Khandual wrote: > On 07/06/2017 02:52 AM, Ram Pai wrote: > > Capture the protection key that got violated in paca. > > This value will be used by used to inform the signal > > handler. > > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/incl

Re: [RFC v5 00/38] powerpc: Memory Protection Keys

2017-07-09 Thread Anshuman Khandual
On 07/06/2017 02:51 AM, Ram Pai wrote: > Memory protection keys enable applications to protect its > address space from inadvertent access or corruption from > itself. > > The overall idea: > > A process allocates a key and associates it with > an address range withinits address s

Re: [RFC v5 31/38] powerpc: introduce get_pte_pkey() helper

2017-07-09 Thread Anshuman Khandual
On 07/06/2017 02:52 AM, Ram Pai wrote: > get_pte_pkey() helper returns the pkey associated with > a address corresponding to a given mm_struct. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/book3s/64/mmu-hash.h |5 > arch/powerpc/mm/hash_utils_64.c | 28 >

Re: [RFC v5 33/38] powerpc: Deliver SEGV signal on pkey violation

2017-07-09 Thread Anshuman Khandual
On 07/06/2017 02:52 AM, Ram Pai wrote: > The value of the AMR register at the time of exception > is made available in gp_regs[PT_AMR] of the siginfo. > > The value of the pkey, whose protection got violated, > is made available in si_pkey field of the siginfo structure. > > Signed-off-by: Ram Pa

Re: [RFC v5 32/38] powerpc: capture the violated protection key on fault

2017-07-09 Thread Anshuman Khandual
On 07/06/2017 02:52 AM, Ram Pai wrote: > Capture the protection key that got violated in paca. > This value will be used by used to inform the signal > handler. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/paca.h |1 + > arch/powerpc/kernel/asm-offsets.c |1 + > arch/pow

Re: [RFC v5 34/38] procfs: display the protection-key number associated with a vma

2017-07-09 Thread Anshuman Khandual
On 07/06/2017 02:52 AM, Ram Pai wrote: > Display the pkey number associated with the vma in smaps of a task. > The key will be seen as below: > > ProtectionKey: 0 > > Signed-off-by: Ram Pai > --- > arch/powerpc/kernel/setup_64.c |8 > 1 files changed, 8 insertions(+), 0 deletions(-

Re: [RFC v5 38/38] Documentation: PowerPC specific updates to memory protection keys

2017-07-09 Thread Anshuman Khandual
On 07/06/2017 02:52 AM, Ram Pai wrote: > Add documentation updates that capture PowerPC specific changes. > > Signed-off-by: Ram Pai > --- > Documentation/vm/protection-keys.txt | 85 > ++ > 1 files changed, 65 insertions(+), 20 deletions(-) > > diff --git a/D