[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57850F1B.4080306@sr71.net>
Date: Tue, 12 Jul 2016 08:39:07 -0700
From: Dave Hansen <dave@...1.net>
To: Ingo Molnar <mingo@...nel.org>
Cc: Andy Lutomirski <luto@...capital.net>,
linux-arch <linux-arch@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux API <linux-api@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Hugh Dickins <hughd@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH 6/9] x86, pkeys: add pkey set/get syscalls
On 07/12/2016 12:13 AM, Ingo Molnar wrote:
>> > Remember, PKRU is just a *bitmap*. The only place keys are stored is in the
>> > page tables.
> A pkey is an index *and* a protection mask. So by representing it as a bitmask we
> lose per thread information. This is what I meant by 'incomplete shadowing' - for
> example the debug code couldn't work: if we cleared a pkey in a task we wouldn't
> know what to restore it to with the current data structures, right?
Right. I actually have some code to do the shadowing that I wrote to
explore how to do different PKRU values in signal handlers. The code
only shadowed the keys that were currently allocated, and used the
(mm-wide) allocation map to figure that out. It did not have a separate
per-thread concept of which parts of PKRU need to be shadowed.
It essentially populated the shadow value on all pkru_set() calls.
Powered by blists - more mailing lists