lkml.org 
[lkml]   [2017]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 29/51] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface
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 hardware registers to determine
> > > > which hardware features are enabled by the kernel.
> > >
> > > No, we use CPUID. It's a part of the ISA that's designed for
> > > enumerating CPU and (sometimes) OS support for CPU features.
> > >
> > > > 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 are currently enabled/used by the
> > > > kernel; atleast not for the memory-key feature.
> > >
> > > Bummer. You're missing out.
> > >
> > > But, you could still do this with a syscall. "Hey, kernel, do you
> > > support this feature?"
> >
> > or do powerpc specific sysfs interface.
> > or a debugfs interface.
>
> getauxval(3) ?
>
> With AT_HWCAP or HWCAP2 as parameter already gives information about
> features supported by the hardware and the kernel.
>
> Taking one bit to expose the availability of protection keys to
> applications does not look impossible.
>
> Do I miss something obvious?

No. I am told this is possible aswell.

RP

\
 
 \ /
  Last update: 2017-12-19 17:23    [W:0.074 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site