lkml.org 
[lkml]   [2019]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC 00/10] Process-local memory allocations for hiding KVM secrets
From
Date
> On Jun 17, 2019, at 9:14 AM, Andy Lutomirski <luto@kernel.org> wrote:
>
> On Mon, Jun 17, 2019 at 9:09 AM Dave Hansen <dave.hansen@intel.com> wrote:
>> On 6/17/19 8:54 AM, Andy Lutomirski wrote:
>>>>> Would that mean that with Meltdown affected CPUs we open speculation
>>>>> attacks against the mmlocal memory from KVM user space?
>>>> Not necessarily. There would likely be a _set_ of local PGDs. We could
>>>> still have pair of PTI PGDs just like we do know, they'd just be a local
>>>> PGD pair.
>>> Unfortunately, this would mean that we need to sync twice as many
>>> top-level entries when we context switch.
>>
>> Yeah, PTI sucks. :)
>>
>> For anyone following along at home, I'm going to go off into crazy
>> per-cpu-pgds speculation mode now... Feel free to stop reading now. :)
>>
>> But, I was thinking we could get away with not doing this on _every_
>> context switch at least. For instance, couldn't 'struct tlb_context'
>> have PGD pointer (or two with PTI) in addition to the TLB info? That
>> way we only do the copying when we change the context. Or does that tie
>> the implementation up too much with PCIDs?
>
> Hmm, that seems entirely reasonable. I think the nasty bit would be
> figuring out all the interactions with PV TLB flushing. PV TLB
> flushes already don't play so well with PCID tracking, and this will
> make it worse. We probably need to rewrite all that code regardless.

How is PCID (as you implemented) related to TLB flushing of kernel (not
user) PTEs? These kernel PTEs would be global, so they would be invalidated
from all the address-spaces using INVLPG, I presume. No?

Having said that, the fact that every hypervisor implements PV-TLB
completely differently might be unwarranted.

\
 
 \ /
  Last update: 2019-06-17 18:55    [W:0.096 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site