Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-20 Thread Benjamin Herrenschmidt
On Wed, 2017-12-20 at 09:50 -0800, Ram Pai wrote: > The argument against this patch is -- it should not be baked into > the ABI as yet, since we do not have clarity on what applications need. > > As it stands today the only way to figure out the information from > userspace is by probing the kern

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-20 Thread Ram Pai
On Wed, Dec 20, 2017 at 08:34:56AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2017-12-18 at 14:28 -0800, Dave Hansen wrote: > > > We do not have generic support for something like that on ppc. > > > The kernel looks at the device tree to determine what hardware features > > > are available. But

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-19 Thread Benjamin Herrenschmidt
On Mon, 2017-12-18 at 14:28 -0800, Dave Hansen wrote: > > We do not have generic support for something like that on ppc. > > The kernel looks at the device tree to determine what hardware features > > are available. But does not have mechanism to tell the hardware to track > > which of its features

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-19 Thread Ram Pai
On Tue, Dec 19, 2017 at 09:50:24PM +1100, Michael Ellerman wrote: > Dave Hansen writes: > > > On 11/06/2017 12:57 AM, Ram Pai wrote: > >> Expose useful information for programs using memory protection keys. > >> Provide implementation for powerpc and x86. > >> > >> On a powerpc system with pkeys

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-19 Thread Ram Pai
On Tue, Dec 19, 2017 at 09:31:22AM +0100, Gabriel Paubert wrote: > On Mon, Dec 18, 2017 at 03:15:51PM -0800, Ram Pai wrote: > > On Mon, Dec 18, 2017 at 02:28:14PM -0800, Dave Hansen wrote: > > > On 12/18/2017 02:18 PM, Ram Pai wrote: > > > snip... > > > > I think on x86 you look for some hardw

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-19 Thread Michael Ellerman
Dave Hansen writes: > On 11/06/2017 12:57 AM, Ram Pai wrote: >> Expose useful information for programs using memory protection keys. >> Provide implementation for powerpc and x86. >> >> On a powerpc system with pkeys support, here is what is shown: >> >> $ head /sys/kernel/mm/protection_keys/*

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-19 Thread Gabriel Paubert
On Mon, Dec 18, 2017 at 03:15:51PM -0800, Ram Pai wrote: > On Mon, Dec 18, 2017 at 02:28:14PM -0800, Dave Hansen wrote: > > On 12/18/2017 02:18 PM, Ram Pai wrote: > > > b) minimum number of keys available to the application. > > > if libraries consumes a few, they could provide a library > > >

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-18 Thread Ram Pai
On Mon, Dec 18, 2017 at 02:28:14PM -0800, Dave Hansen wrote: > On 12/18/2017 02:18 PM, Ram Pai wrote: > > b) minimum number of keys available to the application. > > if libraries consumes a few, they could provide a library > > interface to the application informing the number available to

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-18 Thread Dave Hansen
On 12/18/2017 02:18 PM, Ram Pai wrote: > b) minimum number of keys available to the application. > if libraries consumes a few, they could provide a library > interface to the application informing the number available to > the application. The library interface can leverage (b)

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-18 Thread Ram Pai
On Mon, Dec 18, 2017 at 10:54:26AM -0800, Dave Hansen wrote: > On 11/06/2017 12:57 AM, Ram Pai wrote: > > Expose useful information for programs using memory protection keys. > > Provide implementation for powerpc and x86. > > > > On a powerpc system with pkeys support, here is what is shown: > >

Re: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-12-18 Thread Dave Hansen
On 11/06/2017 12:57 AM, Ram Pai wrote: > Expose useful information for programs using memory protection keys. > Provide implementation for powerpc and x86. > > On a powerpc system with pkeys support, here is what is shown: > > $ head /sys/kernel/mm/protection_keys/* > ==> /sys/kernel/mm/protectio

[PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-11-06 Thread Ram Pai
From: Thiago Jung Bauermann Expose useful information for programs using memory protection keys. Provide implementation for powerpc and x86. On a powerpc system with pkeys support, here is what is shown: $ head /sys/kernel/mm/protection_keys/* ==> /sys/kernel/mm/protection_keys/disable_access_s