[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170922164752.GQ5698@ram.oc3035372033.ibm.com>
Date: Fri, 22 Sep 2017 09:47:52 -0700
From: Ram Pai <linuxram@...ibm.com>
To: Balbir Singh <bsingharora@...il.com>
Cc: mpe@...erman.id.au, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
linux-mm@...ck.org, x86@...nel.org, linux-doc@...r.kernel.org,
arnd@...db.de, akpm@...ux-foundation.org, corbet@....net,
mingo@...hat.com, benh@...nel.crashing.org, paulus@...ba.org,
khandual@...ux.vnet.ibm.com, aneesh.kumar@...ux.vnet.ibm.com,
hbabu@...ibm.com, mhocko@...nel.org, bauerman@...ux.vnet.ibm.com,
ebiederm@...ssion.com, dave.hansen@...el.com
Subject: Re: [PATCH 4/6] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add
sysfs interface
On Fri, Sep 22, 2017 at 04:00:19PM +1000, Balbir Singh wrote:
> On Fri, 15 Sep 2017 18:21:08 -0700
> Ram Pai <linuxram@...ibm.com> wrote:
>
> > From: Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com>
> >
> > 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_supported <==
> > true
> >
> > ==> /sys/kernel/mm/protection_keys/disable_execute_supported <==
> > true
> >
> > ==> /sys/kernel/mm/protection_keys/disable_write_supported <==
> > true
> >
> > ==> /sys/kernel/mm/protection_keys/total_keys <==
> > 32
> >
> > ==> /sys/kernel/mm/protection_keys/usable_keys <==
> > 29
> >
> > And on an x86 without pkeys support:
> >
> > $ head /sys/kernel/mm/protection_keys/*
> > ==> /sys/kernel/mm/protection_keys/disable_access_supported <==
> > false
> >
> > ==> /sys/kernel/mm/protection_keys/disable_execute_supported <==
> > false
> >
> > ==> /sys/kernel/mm/protection_keys/disable_write_supported <==
> > false
> >
> > ==> /sys/kernel/mm/protection_keys/total_keys <==
> > 1
> >
> > ==> /sys/kernel/mm/protection_keys/usable_keys <==
> > 0
> >
> > Signed-off-by: Ram Pai <linuxram@...ibm.com>
> > Signed-off-by: Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com>
> > ---
>
> Just curious, how do you see this being used?
> For debugging or will applications parse these properties and use them?
Its upto the application to determine the best way to fully exploit all
the keys. But that cannot happen if the application has no easy way to
determine the number of available keys.
> It's hard for an application to partition its address space
> among keys at runtime, would you agree?
Why would it be hard? Because the application may not know; in advance,
the range of its address space? Well that is true. But that may not be
the best strategy. It should not be based on how large its address space
range is, rather it should be based on how many unique access-domains it
will need. It can associate a key with each domain and it can associate
address-ranges to the appropriate domains. The more the number
of keys the more the number of access-domains and finer the control.
>
> Balbir Singh.
--
Ram Pai
Powered by blists - more mailing lists