[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4CCD6641-4CCC-485A-BDD9-50751C4139B0@amacapital.net>
Date: Fri, 19 Oct 2018 10:37:16 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Andrew Lutomirski <luto@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
Radim Krcmar <rkrcmar@...hat.com>,
kvm list <kvm@...r.kernel.org>,
"Jason A. Donenfeld" <Jason@...c4.com>,
Rik van Riel <riel@...riel.com>
Subject: Re: [PATCH 05/11] x86/fpu: set PKRU state for kernel threads
> On Oct 19, 2018, at 10:01 AM, Dave Hansen <dave.hansen@...ux.intel.com> wrote:
>
> On 10/19/2018 09:59 AM, Andy Lutomirski wrote:
>>> That looks like a good API in general. The ffs_user_copy_worker that
>>> Sebastian mentioned seems to be used by AIO, in which case of course it
>>> has to happen in a kernel thread.
>>>
>>> But while the API is good, deciding on the desired semantics is
>>> "interesting". The submitting thread might be changing PKRU between the
>>> time the I/O operation is submitted and the time it is completed, for
>>> example.
>> I think there’s only one sensible answer: capture PKRU at the time of submission.
>
> I think it's much more straightforward to just not enforce pkeys.
> Having this "phantom" value could cause a very odd, nearly undebuggable
> I/O failure.
But now we have the reverse. The IO can work if it’s truly async but, if the kernel decides to synchronously complete IO (with GUP or copy_to_user), it’ll fail, right. This isn’t exactly friendly either.
Powered by blists - more mailing lists