Historical speck list archives
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH 1/1 v2] Linux patch #1
Date: Sat, 30 Jun 2018 09:59:46 -0500	[thread overview]
Message-ID: <20180630145946.qzcpfnb6dkhtzsmg@treble> (raw)
In-Reply-To: <20180630004130.GE17013@tassilo.jf.intel.com>

On Fri, Jun 29, 2018 at 05:41:30PM -0700, speck for Andi Kleen wrote:
> > I do understand your arugment, but given all the pushback you're giving to 
> > the "simple" solution, I guess it's now your turn to propose how _exactly_ 
> > this should be done.
> 
> Right.
> 
> I think the key missing piece is a Documentation/ file that describes
> what to do, and to which KVM can point to. I'll look into this next week.
> 
> > 
> > Namely, we need to make sure that
> > 
> > - whoever provides public VMs (cloud providers) gets the right (all) 
> >   mitigations; at the same time, any performance loss that would not
> >   be security-justified is a no-go
> 
> These will be using a wide variety of mitigations depending on their
> circumstances (e.g. likely per core binding or some others like falling 
> back to shadow page tables for UP), likely few will be 
> using SMT off
> 
> They should know what they are doing.

Why not have the best of both worlds:

- have sane defaults for the average user, so you can use l1tf=on and
  know that you're safe without needing a PhD;

- give power users the ability to tweak the default so they can decide
  where they want to be on the security/performance continuum.

So I would propose a simple l1tf=on/off cmdline option:

- on:  non-forced nosmt + confined flush + PTEINV
- off: PTEINV only (is there ever a reason to turn it off?)

And a similar runtime knob at

  /sys/devices/system/cpu/vulnerabilities/l1tf
  
so the user (or virtualization manager) can make that decision at game
time (and even undo it after shutting down the VM).

For power users who want to tweak, after setting l1tf=on, they could
selectively re-enable SMT threads as they wish.  In that case, when
running a VM on a CPU which has an online sibling, kvm can print a
one-time warning message, basically: "I hope you know what you're
doing".

There could also be another warning message for the l1tf=off case, when
starting a VM on a CPU which has a sibling: "If your VM contains
untrusted code, you should set l1tf=on".

And there could be flags provided by the user to skip the warnings, like
"I know what I'm doing" or "I trust the VM".

-- 
Josh

  parent reply	other threads:[~2018-06-30 14:59 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 22:53 [MODERATED] [PATCH 1/1] Linux patch #1 Jiri Kosina
2018-06-28 23:15 ` [MODERATED] " Jiri Kosina
2018-06-28 23:36 ` [MODERATED] [PATCH 1/1 v2] " Jiri Kosina
2018-06-29  8:38   ` [MODERATED] " Borislav Petkov
2018-06-29 15:43   ` Thomas Gleixner
2018-06-29 15:46     ` Thomas Gleixner
2018-06-29 16:48   ` [MODERATED] " Josh Poimboeuf
2018-06-29 16:49     ` Josh Poimboeuf
2018-06-29 19:47     ` Thomas Gleixner
2018-06-29 19:54       ` [MODERATED] " Josh Poimboeuf
2018-06-29 21:26         ` Jiri Kosina
2018-06-29 21:28           ` Jiri Kosina
2018-06-29 22:05             ` Andi Kleen
2018-06-29 22:17               ` Jiri Kosina
2018-06-29 23:21                 ` Andi Kleen
2018-06-29 23:33                   ` Jiri Kosina
2018-06-29 23:37                     ` Jiri Kosina
2018-06-29 23:44                     ` Andi Kleen
2018-06-30  0:02                       ` Jiri Kosina
2018-06-30  0:41                         ` Andi Kleen
2018-06-30  0:50                           ` Jiri Kosina
2018-06-30  8:59                           ` Thomas Gleixner
2018-06-30 17:42                             ` [MODERATED] " Linus Torvalds
2018-06-30 19:30                               ` Jiri Kosina
2018-06-30 19:52                                 ` Linus Torvalds
2018-06-30 19:58                                   ` Jiri Kosina
2018-07-02 14:52                                     ` Konrad Rzeszutek Wilk
2018-07-02  8:06                               ` Thomas Gleixner
2018-07-05 20:03                             ` [MODERATED] " Jon Masters
2018-07-05 20:16                               ` Jiri Kosina
2018-07-05 21:29                                 ` Jon Masters
2018-07-05 21:39                                   ` Jiri Kosina
2018-07-05 22:19                                     ` Thomas Gleixner
2018-07-05 23:49                                       ` [MODERATED] " Josh Poimboeuf
2018-07-05 20:25                               ` Linus Torvalds
2018-07-05 20:50                                 ` Thomas Gleixner
2018-07-05 21:21                                   ` [MODERATED] " Jon Masters
2018-07-05 21:24                                     ` Jon Masters
2018-06-30 14:59                           ` Josh Poimboeuf [this message]
2018-06-30 23:34                           ` Dave Hansen
2018-07-01  0:06                             ` Linus Torvalds
2018-06-29 21:46           ` Josh Poimboeuf
2018-06-29 21:49           ` Andi Kleen
2018-06-29 21:56             ` Jiri Kosina
2018-06-29 22:05               ` Thomas Gleixner
2018-06-29 22:43               ` [MODERATED] " Luck, Tony
2018-06-30  9:05             ` Thomas Gleixner
2018-06-30 19:48 ` [MODERATED] [PATCH 1/1 v3] " Jiri Kosina
2018-06-30 21:31   ` [MODERATED] " Josh Poimboeuf
2018-06-30 21:35     ` Linus Torvalds
2018-06-30 21:43     ` Jiri Kosina
2018-06-30 22:22 ` [MODERATED] [PATCH 1/1 v4] " Jiri Kosina
2018-07-02 14:51   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-07-02 15:00     ` Jiri Kosina
2018-07-02 15:14       ` 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=20180630145946.qzcpfnb6dkhtzsmg@treble \
    --to=jpoimboe@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).