mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Laura Abbott <labbott@redhat.com>, X86 ML <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable <stable@vger.kernel.org>
Subject: Re: Yet another KPTI regression with 4.14.x series in a VM
Date: Sat, 13 Jan 2018 13:50:55 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1801131342380.2371@nanos> (raw)
In-Reply-To: <20180113120847.GI3397@worktop>

On Sat, 13 Jan 2018, Peter Zijlstra wrote:

> On Fri, Jan 12, 2018 at 10:08:20PM -0800, Andy Lutomirski wrote:
> > Now this is quite a strange value to write to CR3.  The 0x800 part
> > means that we're using the "user" variant of the address space that
> > would have ASID=0 and the 0x1000 bit being set corresponds to the user
> > pgdir, but this is nonsense, since the kernel never uses PCID 0 for
> > user mode.  We always start at 1.  The only exception is if
> > X86_FEATURE_PCID is off.  But, if X86_FEATURE_PCID is off, then we
> > shouldn't be setting any PCID bits.
> 
> My bad, I was under the impression the lower 12 bits would be ignored
> without PCID :/

 2:0 Ignored
   3 PWT
   4 PCD
11:5 Ignored

So yes, it's mostly ignored at least in theory... I'm sure I stared at that
code and the SDM more than once and convinced myself that it's not an issue
to set bit 11 unconditionally.

But I should have stared at the AMD manual which says:

Reserved Bits. Reserved fields should be cleared to 0 by software when writing CR3.

Thanks,

	tglx

  parent reply	other threads:[~2018-01-13 12:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 18:19 Laura Abbott
2018-01-12 18:51 ` Thomas Gleixner
2018-01-12 21:30   ` Laura Abbott
2018-01-12 21:51     ` Thomas Gleixner
2018-01-13  6:08       ` Andy Lutomirski
2018-01-13  6:33         ` Willy Tarreau
2018-01-13 20:01           ` Andy Lutomirski
2018-01-13 20:45             ` Thomas Gleixner
2018-01-13 20:52               ` Andy Lutomirski
2018-01-13 12:08         ` Peter Zijlstra
2018-01-13 12:30           ` David Woodhouse
2018-01-13 13:10             ` Peter Zijlstra
2018-01-13 13:39               ` David Woodhouse
2018-01-13 14:14               ` David Woodhouse
2018-01-13 12:50           ` Thomas Gleixner [this message]
2018-01-13 13:51             ` Borislav Petkov

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=alpine.DEB.2.20.1801131342380.2371@nanos \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®