All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH 8/8] L1TFv8 6
Date: Tue, 26 Jun 2018 15:05:03 +0200	[thread overview]
Message-ID: <20180626130503.GX28965@dhcp22.suse.cz> (raw)
In-Reply-To: <20180626125750.GW28965@dhcp22.suse.cz>

On Tue 26-06-18 14:57:50, speck for Michal Hocko wrote:
> On Tue 26-06-18 14:01:18, speck for Vlastimil Babka wrote:
> > On 06/25/2018 10:31 PM, speck for Andi Kleen wrote:
> [...]
> > >From 94b19f2277984594eda826a315cb49d6be5375b5 Mon Sep 17 00:00:00 2001
> > From: Vlastimil Babka <vbabka@suse.cz>
> > Date: Fri, 22 Jun 2018 17:39:33 +0200
> > Subject: [PATCH] x86/speculation/l1tf: protect PAE swap entries against L1TF
> > 
> > The PAE 3-level paging code currently doesn't mitigate L1TF by flipping the
> > offset bits, and uses the high PTE word, thus bits 32-36 for type, 37-63 for
> > offset. The lower word is zeroed, thus systems with less than 4GB memory are
> > safe. With 4GB to 128GB the swap type selects the memory locations vulnerable
> > to L1TF; with even more memory, also the swap offfset influences the address.
> > This might be a problem with 32bit PAE guests running on large 64bit hosts.
> > 
> > By continuing to keep the whole swap entry in either high or low 32bit word of
> > PTE we would limit the swap size too much. Thus this patch uses the whole PAE
> > PTE with the same layout as the 64bit version does. The macros just become a
> > bit tricky since they assume the arch-dependent swp_entry_t to be 32bit.
> 
> I have expected this to be even ugglier but it seems quite sane in the
> end.

And just for the record. I was worried that the 64b swap entry would
lead to RMW issues because we are not doing the single write to u64 on
32b but all swap entries constructors I can see are local and only made
visible later. Regular ptes handle that already but I was worried that
having swap entries special could lead to some subtle issues but I
cannot see any in the code.
 
> > Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> 
> Acked-by: Michal Hocko <mhocko@suse.com>
> 
> Thanks!
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-06-26 13:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 22:48 [MODERATED] [PATCH 0/8] L1TFv8 2 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 1/8] L1TFv8 0 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 2/8] L1TFv8 4 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 3/8] L1TFv8 5 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 4/8] L1TFv8 8 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 5/8] L1TFv8 3 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 6/8] L1TFv8 7 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 7/8] L1TFv8 1 Andi Kleen
2018-06-13 22:48 ` [MODERATED] [PATCH 8/8] L1TFv8 6 Andi Kleen
     [not found] ` <20180614150632.E064C61183@crypto-ml.lab.linutronix.de>
2018-06-21  9:02   ` [MODERATED] " Vlastimil Babka
2018-06-21 11:43     ` Vlastimil Babka
2018-06-21 13:17       ` Vlastimil Babka
2018-06-21 14:38         ` Michal Hocko
2018-06-21 14:38         ` Thomas Gleixner
2018-06-21 20:32         ` [MODERATED] " Andi Kleen
2018-06-22 15:46       ` Vlastimil Babka
2018-06-22 16:56         ` Andi Kleen
2018-06-25  7:04           ` Vlastimil Babka
2018-06-25 20:31             ` Andi Kleen
2018-06-26 12:01               ` Vlastimil Babka
2018-06-26 12:57                 ` Michal Hocko
2018-06-26 13:05                   ` Michal Hocko [this message]
2018-06-27  9:14                 ` Thomas Gleixner
     [not found] ` <20180613225434.1CDC8610FD@crypto-ml.lab.linutronix.de>
2018-06-27 15:51   ` [MODERATED] Re: x86/speculation/l1tf: Protect PROT_NONE PTEs against speculation Michal Hocko
2018-06-28  8:05     ` [MODERATED] Re: [PATCH 4/8] L1TFv8 8 Vlastimil Babka
2018-06-29 12:22       ` Michal Hocko

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=20180626130503.GX28965@dhcp22.suse.cz \
    --to=mhocko@suse.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.