Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-18 Thread Michael Ellerman
Dave Hansen writes: > On 03/17/2018 02:12 AM, Thomas Gleixner wrote: >>> This is a bit nicer than what Ram proposed because it is simpler >>> and removes special-casing for pkey 0. On the other hand, it does >>> allow applciations to pkey_free() pkey-0, but that's just a

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-18 Thread Michael Ellerman
Dave Hansen writes: > On 03/17/2018 02:12 AM, Thomas Gleixner wrote: >>> This is a bit nicer than what Ram proposed because it is simpler >>> and removes special-casing for pkey 0. On the other hand, it does >>> allow applciations to pkey_free() pkey-0, but that's just a silly >>> thing to do,

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-18 Thread Ram Pai
On Sun, Mar 18, 2018 at 10:30:48AM +0100, Thomas Gleixner wrote: > On Sat, 17 Mar 2018, Ram Pai wrote: > > On Fri, Mar 16, 2018 at 02:46:56PM -0700, Dave Hansen wrote: > > > > > > From: Dave Hansen > > > > > > mm_pkey_is_allocated() treats pkey 0 as unallocated.

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-18 Thread Ram Pai
On Sun, Mar 18, 2018 at 10:30:48AM +0100, Thomas Gleixner wrote: > On Sat, 17 Mar 2018, Ram Pai wrote: > > On Fri, Mar 16, 2018 at 02:46:56PM -0700, Dave Hansen wrote: > > > > > > From: Dave Hansen > > > > > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > > > inconsistent with

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-18 Thread Thomas Gleixner
On Sat, 17 Mar 2018, Ram Pai wrote: > On Fri, Mar 16, 2018 at 02:46:56PM -0700, Dave Hansen wrote: > > > > From: Dave Hansen > > > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > > inconsistent with the manpages, and also inconsistent with > >

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-18 Thread Thomas Gleixner
On Sat, 17 Mar 2018, Ram Pai wrote: > On Fri, Mar 16, 2018 at 02:46:56PM -0700, Dave Hansen wrote: > > > > From: Dave Hansen > > > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > > inconsistent with the manpages, and also inconsistent with > > mm->context.pkey_allocation_map.

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Dave Hansen
On 03/17/2018 04:24 PM, Ram Pai wrote: > So the difference between the two proposals is just the freeing part i.e (b). > Did I get this right? Yeah, I think that's the only difference.

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Dave Hansen
On 03/17/2018 04:24 PM, Ram Pai wrote: > So the difference between the two proposals is just the freeing part i.e (b). > Did I get this right? Yeah, I think that's the only difference.

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Ram Pai
On Fri, Mar 16, 2018 at 02:46:56PM -0700, Dave Hansen wrote: > > From: Dave Hansen > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > inconsistent with the manpages, and also inconsistent with > mm->context.pkey_allocation_map. Stop special casing

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Ram Pai
On Fri, Mar 16, 2018 at 02:46:56PM -0700, Dave Hansen wrote: > > From: Dave Hansen > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > inconsistent with the manpages, and also inconsistent with > mm->context.pkey_allocation_map. Stop special casing it and only > disallow values

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Thomas Gleixner
On Sat, 17 Mar 2018, Dave Hansen wrote: > On 03/17/2018 02:12 AM, Thomas Gleixner wrote: > >> This is a bit nicer than what Ram proposed because it is simpler > >> and removes special-casing for pkey 0. On the other hand, it does > >> allow applciations to pkey_free() pkey-0, but that's just a

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Thomas Gleixner
On Sat, 17 Mar 2018, Dave Hansen wrote: > On 03/17/2018 02:12 AM, Thomas Gleixner wrote: > >> This is a bit nicer than what Ram proposed because it is simpler > >> and removes special-casing for pkey 0. On the other hand, it does > >> allow applciations to pkey_free() pkey-0, but that's just a

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Dave Hansen
On 03/17/2018 02:12 AM, Thomas Gleixner wrote: >> This is a bit nicer than what Ram proposed because it is simpler >> and removes special-casing for pkey 0. On the other hand, it does >> allow applciations to pkey_free() pkey-0, but that's just a silly >> thing to do, so we are not going to

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Dave Hansen
On 03/17/2018 02:12 AM, Thomas Gleixner wrote: >> This is a bit nicer than what Ram proposed because it is simpler >> and removes special-casing for pkey 0. On the other hand, it does >> allow applciations to pkey_free() pkey-0, but that's just a silly >> thing to do, so we are not going to

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Thomas Gleixner
On Fri, 16 Mar 2018, Dave Hansen wrote: > > From: Dave Hansen > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > inconsistent with the manpages, and also inconsistent with > mm->context.pkey_allocation_map. Stop special casing it and only >

Re: [PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-17 Thread Thomas Gleixner
On Fri, 16 Mar 2018, Dave Hansen wrote: > > From: Dave Hansen > > mm_pkey_is_allocated() treats pkey 0 as unallocated. That is > inconsistent with the manpages, and also inconsistent with > mm->context.pkey_allocation_map. Stop special casing it and only > disallow values that are actually

[PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-16 Thread Dave Hansen
From: Dave Hansen mm_pkey_is_allocated() treats pkey 0 as unallocated. That is inconsistent with the manpages, and also inconsistent with mm->context.pkey_allocation_map. Stop special casing it and only disallow values that are actually bad (< 0). The end-user

[PATCH 1/3] x86, pkeys: do not special case protection key 0

2018-03-16 Thread Dave Hansen
From: Dave Hansen mm_pkey_is_allocated() treats pkey 0 as unallocated. That is inconsistent with the manpages, and also inconsistent with mm->context.pkey_allocation_map. Stop special casing it and only disallow values that are actually bad (< 0). The end-user visible effect of this is that