Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-05 Thread Ram Pai
On Wed, Dec 05, 2018 at 08:21:02AM -0800, Andy Lutomirski wrote: > > On Dec 2, 2018, at 8:02 PM, Ram Pai wrote: > > > >> On Thu, Nov 29, 2018 at 12:37:15PM +0100, Florian Weimer wrote: > >> * Dave Hansen: > >> > On 11/27/18 3:57 AM, Florian Weimer wrote: > I would have expected something

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-05 Thread Ram Pai
On Wed, Dec 05, 2018 at 02:00:59PM +0100, Florian Weimer wrote: > * Ram Pai: > > > Ok. here is a patch, compiled but not tested. See if this meets the > > specifications. > > > > --- > > > > commit 3dc06e73f3795921265d

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-05 Thread Andy Lutomirski
> On Dec 2, 2018, at 8:02 PM, Ram Pai wrote: > >> On Thu, Nov 29, 2018 at 12:37:15PM +0100, Florian Weimer wrote: >> * Dave Hansen: >> On 11/27/18 3:57 AM, Florian Weimer wrote: I would have expected something that translates PKEY_DISABLE_WRITE | PKEY_DISABLE_READ into PKEY_DISABLE_

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-05 Thread Florian Weimer
* Ram Pai: > Ok. here is a patch, compiled but not tested. See if this meets the > specifications. > > --- > > commit 3dc06e73f3795921265d5d1d935e428deab01616 > Author: Ram Pai > Date: Tue Dec 4 00:04:11 2018 -0500

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-03 Thread Ram Pai
On Mon, Dec 03, 2018 at 04:52:02PM +0100, Florian Weimer wrote: > * Ram Pai: > > > So the problem is as follows: > > > > Currently the kernel supports 'disable-write' and 'disable-access'. > > > > On x86, cpu supports 'disable-write' and 'disable-access'. This > > matches with what the kernel su

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-03 Thread Florian Weimer
* Ram Pai: > So the problem is as follows: > > Currently the kernel supports 'disable-write' and 'disable-access'. > > On x86, cpu supports 'disable-write' and 'disable-access'. This > matches with what the kernel supports. All good. > > However on power, cpu supports 'disable-read' too. Since u

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-12-02 Thread Ram Pai
On Thu, Nov 29, 2018 at 12:37:15PM +0100, Florian Weimer wrote: > * Dave Hansen: > > > On 11/27/18 3:57 AM, Florian Weimer wrote: > >> I would have expected something that translates PKEY_DISABLE_WRITE | > >> PKEY_DISABLE_READ into PKEY_DISABLE_ACCESS, and also accepts > >> PKEY_DISABLE_ACCESS | P

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-29 Thread Florian Weimer
* Dave Hansen: > On 11/27/18 3:57 AM, Florian Weimer wrote: >> I would have expected something that translates PKEY_DISABLE_WRITE | >> PKEY_DISABLE_READ into PKEY_DISABLE_ACCESS, and also accepts >> PKEY_DISABLE_ACCESS | PKEY_DISABLE_READ, for consistency with POWER. >> >> (My understanding is th

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-27 Thread Dave Hansen
On 11/27/18 3:57 AM, Florian Weimer wrote: > I would have expected something that translates PKEY_DISABLE_WRITE | > PKEY_DISABLE_READ into PKEY_DISABLE_ACCESS, and also accepts > PKEY_DISABLE_ACCESS | PKEY_DISABLE_READ, for consistency with POWER. > > (My understanding is that PKEY_DISABLE_ACCESS

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-27 Thread Florian Weimer
* Ram Pai: > diff --git a/arch/x86/include/uapi/asm/mman.h > b/arch/x86/include/uapi/asm/mman.h > index d4a8d04..e9b121b 100644 > --- a/arch/x86/include/uapi/asm/mman.h > +++ b/arch/x86/include/uapi/asm/mman.h > @@ -24,6 +24,11 @@ > ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \ >

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-27 Thread Ram Pai
On Mon, Nov 12, 2018 at 01:00:19PM +0100, Florian Weimer wrote: > * Ram Pai: > > > On Thu, Nov 08, 2018 at 09:23:35PM +0100, Florian Weimer wrote: > >> * Ram Pai: > >> > >> > Florian, > >> > > >> > I can. But I am struggling to understand the requirement. Why is > >> > this needed? Are we prop

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-12 Thread Florian Weimer
* Ram Pai: > On Thu, Nov 08, 2018 at 09:23:35PM +0100, Florian Weimer wrote: >> * Ram Pai: >> >> > Florian, >> > >> >I can. But I am struggling to understand the requirement. Why is >> >this needed? Are we proposing a enhancement to the sys_pkey_alloc(), >> >to be able to allocate ke

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-12 Thread Florian Weimer
* Ram Pai: > On Thu, Nov 08, 2018 at 01:05:09PM +0100, Florian Weimer wrote: >> Would it be possible to reserve a bit for PKEY_DISABLE_READ? >> >> I think the POWER implementation can disable read access at the hardware >> level, but not write access, and that cannot be expressed with the >> curr

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-09 Thread Ram Pai
On Thu, Nov 08, 2018 at 09:23:35PM +0100, Florian Weimer wrote: > * Ram Pai: > > > Florian, > > > > I can. But I am struggling to understand the requirement. Why is > > this needed? Are we proposing a enhancement to the sys_pkey_alloc(), > > to be able to allocate keys that are initia

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-08 Thread Florian Weimer
* Ram Pai: > Florian, > > I can. But I am struggling to understand the requirement. Why is > this needed? Are we proposing a enhancement to the sys_pkey_alloc(), > to be able to allocate keys that are initialied to disable-read > only? Yes, I think that would be a natural

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-08 Thread Ram Pai
On Thu, Nov 08, 2018 at 06:37:41PM +0100, Florian Weimer wrote: > * Dave Hansen: > > > On 11/8/18 7:01 AM, Florian Weimer wrote: > >> Ideally, PKEY_DISABLE_READ | PKEY_DISABLE_WRITE and PKEY_DISABLE_READ | > >> PKEY_DISABLE_ACCESS would be treated as PKEY_DISABLE_ACCESS both, and a > >> line PKEY_

Re: pkeys: Reserve PKEY_DISABLE_READ

2018-11-08 Thread Ram Pai
On Thu, Nov 08, 2018 at 01:05:09PM +0100, Florian Weimer wrote: > Would it be possible to reserve a bit for PKEY_DISABLE_READ? > > I think the POWER implementation can disable read access at the hardware > level, but not write access, and that cannot be expressed with the > current PKEY_DISABLE_AC