[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181108150405.GB14072@linux.intel.com>
Date: Thu, 8 Nov 2018 17:04:05 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Sean Christopherson <sean.j.christopherson@...el.com>,
Andy Lutomirski <luto@...nel.org>,
Jann Horn <jannh@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Rich Felker <dalias@...c.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Jethro Beekman <jethro@...tanix.com>,
Florian Weimer <fweimer@...hat.com>,
Linux API <linux-api@...r.kernel.org>, X86 ML <x86@...nel.org>,
linux-arch <linux-arch@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>, nhorman@...hat.com,
npmccallum@...hat.com, "Ayoun, Serge" <serge.ayoun@...el.com>,
shay.katz-zamir@...el.com, linux-sgx@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Carlos O'Donell <carlos@...hat.com>,
adhemerval.zanella@...aro.org
Subject: Re: RFC: userspace exception fixups
On Wed, Nov 07, 2018 at 12:56:58PM -0800, Dave Hansen wrote:
> On 11/7/18 11:01 AM, Sean Christopherson wrote:
> > Going off comments in similar code related to UMIP, we'd need to figure
> > out how to handle protection keys.
>
> There are two options:
> 1. Don't depend on the userspace mapping. Do get_user_pages() to find
> the instruction in the kernel direct map, and use that.
> 2. Do a WRPKRU that allows read access, do the read, then put PKRU back.
> This is a pain because of preemption and all that jazz.
>
> Right now, we just let the prefetch instruction detection fail if you
> mark it unreadable with pkeys. Tough cookies, basically. But, that's
> just the kernel being nice, but you need it for functionality, so it's
> tougher.
I would go with one because it is the stable way to do it and we are
100% sure to not conflict with pk's.
/Jarkko
Powered by blists - more mailing lists