All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: L1D-Fault KVM mitigation
Date: Sun, 27 May 2018 20:13:24 +0100	[thread overview]
Message-ID: <a42a4c62-9d2f-b9a2-a58c-0e1aed3d5fe1@citrix.com> (raw)
In-Reply-To: <alpine.LFD.2.21.999.1805271131170.18753@i7.lan>

[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]

On 27/05/2018 19:49, speck for Linus Torvalds wrote:
>
> On Sun, 27 May 2018, speck for Andi Kleen wrote:
>>> Maybe you mean "idle in the _host_"?
>> It's both actually. Either idle in the host, or idle in the guest.
> It really really isn't.
>
> Andi, if one sibling does a vmexit, and the other sibling is still in vmx 
> mode, we have to force-exit the other sibling. It doesn't matter one whit 
> whether it's idle or not - because we won't know.
>
> Or is there some magical sideband that I am not aware of?
>
>> When it's idle in the host we don't need to synchronize, unless 
>> there is an interrupt (which does its own synchronization) because
>> the idle loop has nothing valuable to leak.
> Right. The only case that doesn't need synchronization is "other sibling 
> is idle in the _host_".
>
>> And if it's idle in the guest then the vcpu is blocked and
>> also obviously doesn't need to be synchronized.
> If the other sibling is idle inside the guest, then we don't even know 
> that.
>
> Of course, if somebody is doing exit-on-{hlt/mwait/pause}, and we end up 
> actually being in the host and _emulating_ the idle, then that might be 
> acceptable. Except even then we'd be potentially leaking a *lot* of host 
> caches. The vmx emulation code ends up having a not all that insignificant 
> footprint in that (host percpu state, thread state etc).
>
> But why would you emulate halt/mwait/pause anyway? That sounds insane to 
> me. The reason you would want exit-on-halt is so that the host can do 
> something else if a vcpu goes idle, not so that it can just stay in some 
> emulated idle state.
>
> If you want to go to low-power mode, you'd just let the halt/mwait happen 
> inside the guest.
>
> But to be honest, I haven't actually checked what kvm users (or xen, or 
> whatever) really do. Am I missing something?

Xen doesn't ever vcpus enter idle themselves.  We trap HLT/etc and will
either schedule another VM, or choose to idle the host if there really
is nothing else to do.

I've never come across a plausible usecase for letting non-root mode
idle the cores into a low power state.  They simply aren't in a position
to know whether other work needs doing or not.

~Andrew


  parent reply	other threads:[~2018-05-27 19:13 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24  9:06 [MODERATED] L1D-Fault KVM mitigation Joerg Roedel
2018-04-24  9:35 ` [MODERATED] " Peter Zijlstra
2018-04-24  9:48   ` David Woodhouse
2018-04-24 11:04     ` Peter Zijlstra
2018-04-24 11:16       ` David Woodhouse
2018-04-24 15:10         ` Jon Masters
2018-05-23  9:45       ` David Woodhouse
2018-05-24  9:45         ` Peter Zijlstra
2018-05-24 14:14           ` Jon Masters
2018-05-24 15:04           ` Thomas Gleixner
2018-05-24 15:33             ` Thomas Gleixner
2018-05-24 15:38               ` [MODERATED] " Jiri Kosina
2018-05-24 17:22                 ` Dave Hansen
2018-05-24 17:30                   ` Linus Torvalds
2018-05-24 23:18               ` [MODERATED] Encrypted Message Tim Chen
2018-05-24 23:28                 ` [MODERATED] Re: L1D-Fault KVM mitigation Linus Torvalds
2018-05-25  8:31                   ` Thomas Gleixner
2018-05-28 14:43                     ` [MODERATED] " Paolo Bonzini
2018-05-25 18:22                 ` [MODERATED] Encrypted Message Tim Chen
2018-05-26 19:14                 ` L1D-Fault KVM mitigation Thomas Gleixner
2018-05-26 20:43                   ` [MODERATED] " Andi Kleen
2018-05-26 20:48                     ` Linus Torvalds
2018-05-27 18:25                       ` Andi Kleen
2018-05-27 18:49                         ` Linus Torvalds
2018-05-27 18:57                           ` Thomas Gleixner
2018-05-27 19:13                           ` Andrew Cooper [this message]
2018-05-27 19:26                             ` [MODERATED] " Linus Torvalds
2018-05-27 19:41                               ` Thomas Gleixner
2018-05-27 22:26                                 ` [MODERATED] " Andrew Cooper
2018-05-28  6:47                                   ` Thomas Gleixner
2018-05-28 12:26                                     ` [MODERATED] " Andrew Cooper
2018-05-28 14:40                           ` Paolo Bonzini
2018-05-28 15:56                             ` Thomas Gleixner
2018-05-28 17:15                               ` [MODERATED] " Paolo Bonzini
2018-05-27 15:42                     ` Thomas Gleixner
2018-05-27 16:26                       ` [MODERATED] " Linus Torvalds
2018-05-27 18:31                       ` Andi Kleen
2018-05-29 19:29                   ` [MODERATED] Encrypted Message Tim Chen
2018-05-29 21:14                     ` L1D-Fault KVM mitigation Thomas Gleixner
2018-05-30 16:38                       ` [MODERATED] Encrypted Message Tim Chen
2018-05-24 15:44             ` [MODERATED] Re: L1D-Fault KVM mitigation Andi Kleen
2018-05-24 15:38           ` Linus Torvalds
2018-05-24 15:59             ` David Woodhouse
2018-05-24 16:35               ` Linus Torvalds
2018-05-24 16:51                 ` David Woodhouse
2018-05-24 16:57                   ` Linus Torvalds
2018-05-25 11:29                     ` David Woodhouse
2018-04-24 10:30   ` [MODERATED] Re: ***UNCHECKED*** " Joerg Roedel
2018-04-24 11:09     ` Thomas Gleixner
2018-04-24 16:06       ` [MODERATED] " Andi Kleen
2018-04-24 12:53   ` Paolo Bonzini
2018-05-03 16:20     ` Konrad Rzeszutek Wilk
2018-05-07 17:11       ` Paolo Bonzini
2018-05-16  8:51         ` Jiri Kosina
2018-05-16  8:53           ` Paolo Bonzini
2018-05-21 10:06             ` David Woodhouse
2018-05-21 13:40               ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a42a4c62-9d2f-b9a2-a58c-0e1aed3d5fe1@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=speck@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.