Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698013 > unrolled thread

Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys

Started byThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
First post2017-07-27 16:10 +0200
Last post2017-07-30 00:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2017-07-27 16:10 +0200
    Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys Ram Pai <linuxram@us.ibm.com> - 2017-07-30 00:50 +0200

#1698013 — Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys

FromThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Date2017-07-27 16:10 +0200
SubjectRe: [RFC v6 13/62] powerpc: track allocation status of all pkeys
Message-ID<u7REe-767-19@gated-at.bofh.it>
Hello Ram,

I'm still going through the patches and haven't formed a full picture of
the feature in my mind yet, so my comments today won't be particularly
insightful...

But hopefully the comments that I currently have will be helpful anyway.

Ram Pai <linuxram@us.ibm.com> writes:
> diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
> index 203d7de..09b268e 100644
> --- a/arch/powerpc/include/asm/pkeys.h
> +++ b/arch/powerpc/include/asm/pkeys.h
> @@ -2,21 +2,87 @@
>  #define _ASM_PPC64_PKEYS_H
>
>  extern bool pkey_inited;
> -#define ARCH_VM_PKEY_FLAGS 0
> +#define arch_max_pkey()  32
> +#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | \
> +				VM_PKEY_BIT3 | VM_PKEY_BIT4)
> +/*
> + * Bits are in BE format.
> + * NOTE: key 31, 1, 0 are not used.
> + * key 0 is used by default. It give read/write/execute permission.
> + * key 31 is reserved by the hypervisor.
> + * key 1 is recommended to be not used.
> + * PowerISA(3.0) page 1015, programming note.
> + */
> +#define PKEY_INITIAL_ALLOCAION  0xc0000001

There's a typo in the macro name, should be "ALLOCATION".

-- 
Thiago Jung Bauermann
IBM Linux Technology Center

[toc] | [next] | [standalone]


#1699391

FromRam Pai <linuxram@us.ibm.com>
Date2017-07-30 00:50 +0200
Message-ID<u8IIy-h0-7@gated-at.bofh.it>
In reply to#1698013
On Thu, Jul 27, 2017 at 11:01:44AM -0300, Thiago Jung Bauermann wrote:
> 
> Hello Ram,
> 
> I'm still going through the patches and haven't formed a full picture of
> the feature in my mind yet, so my comments today won't be particularly
> insightful...
> 
> But hopefully the comments that I currently have will be helpful anyway.

sure. thanx for taking the time to look through the patches.

> 
> Ram Pai <linuxram@us.ibm.com> writes:
> > diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
> > index 203d7de..09b268e 100644
> > --- a/arch/powerpc/include/asm/pkeys.h
> > +++ b/arch/powerpc/include/asm/pkeys.h
> > @@ -2,21 +2,87 @@
> >  #define _ASM_PPC64_PKEYS_H
> >
> >  extern bool pkey_inited;
> > -#define ARCH_VM_PKEY_FLAGS 0
> > +#define arch_max_pkey()  32
> > +#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | \
> > +				VM_PKEY_BIT3 | VM_PKEY_BIT4)
> > +/*
> > + * Bits are in BE format.
> > + * NOTE: key 31, 1, 0 are not used.
> > + * key 0 is used by default. It give read/write/execute permission.
> > + * key 31 is reserved by the hypervisor.
> > + * key 1 is recommended to be not used.
> > + * PowerISA(3.0) page 1015, programming note.
> > + */
> > +#define PKEY_INITIAL_ALLOCAION  0xc0000001
> 
> There's a typo in the macro name, should be "ALLOCATION".

Thanks fixed it. The new version of the code, calculates the
allocation_mask at runtime, depending on the number of keys specified by
the device tree as well as other factors.  So the above macro is
replaced by a variable 'initial_allocation_mask'.

RP

> 
> -- 
> Thiago Jung Bauermann
> IBM Linux Technology Center

-- 
Ram Pai

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web