Re: [PATCH v3] x86: treat pkey-0 special

2018-03-15 Thread Ram Pai
On Thu, Mar 15, 2018 at 10:31:51AM -0700, Dave Hansen wrote: > On 03/15/2018 10:21 AM, Ram Pai wrote: > > On Thu, Mar 15, 2018 at 08:55:31AM -0700, Dave Hansen wrote: > >> On 03/15/2018 02:46 AM, Thomas Gleixner wrote: > +if (!pkey || !mm_pkey_is_allocated(mm, pkey)) > >>> Why this ext

Re: [PATCH v3] x86: treat pkey-0 special

2018-03-15 Thread Dave Hansen
On 03/15/2018 10:21 AM, Ram Pai wrote: > On Thu, Mar 15, 2018 at 08:55:31AM -0700, Dave Hansen wrote: >> On 03/15/2018 02:46 AM, Thomas Gleixner wrote: + if (!pkey || !mm_pkey_is_allocated(mm, pkey)) >>> Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true >>> ever. If it

Re: [PATCH v3] x86: treat pkey-0 special

2018-03-15 Thread Ram Pai
On Thu, Mar 15, 2018 at 08:55:31AM -0700, Dave Hansen wrote: > On 03/15/2018 02:46 AM, Thomas Gleixner wrote: > >> + if (!pkey || !mm_pkey_is_allocated(mm, pkey)) > > Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true > > ever. If it does, then this wants to be fixed. > > I

Re: [PATCH v3] x86: treat pkey-0 special

2018-03-15 Thread Thomas Gleixner
On Thu, 15 Mar 2018, Dave Hansen wrote: > On 03/15/2018 02:46 AM, Thomas Gleixner wrote: > >> + if (!pkey || !mm_pkey_is_allocated(mm, pkey)) > > Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true > > ever. If it does, then this wants to be fixed. > > I was thinking that we

Re: [PATCH v3] x86: treat pkey-0 special

2018-03-15 Thread Dave Hansen
On 03/15/2018 02:46 AM, Thomas Gleixner wrote: >> +if (!pkey || !mm_pkey_is_allocated(mm, pkey)) > Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true > ever. If it does, then this wants to be fixed. I was thinking that we _do_ actually want it to seem allocated. It just

Re: [PATCH v3] x86: treat pkey-0 special

2018-03-15 Thread Thomas Gleixner
On Wed, 14 Mar 2018, Ram Pai wrote: > Applications need the ability to associate an address-range with some > key and latter revert to its initial default key. Pkey-0 comes close to > providing this function but falls short, because the current > implementation disallows applications to explicitly

[PATCH v3] x86: treat pkey-0 special

2018-03-14 Thread Ram Pai
Applications need the ability to associate an address-range with some key and latter revert to its initial default key. Pkey-0 comes close to providing this function but falls short, because the current implementation disallows applications to explicitly associate pkey-0 to the address range. This