From: Ingo Molnar <mingo@kernel.org>
To: Laura Abbott <labbott@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Andy Lutomirski <luto@kernel.org>, Willy Tarreau <w@1wt.eu>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@alien8.de>, X86 ML <x86@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
David Woodhouse <dwmw@amazon.co.uk>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] x86/pti: Fix !PCID and sanitize defines
Date: Tue, 16 Jan 2018 01:57:19 +0100 [thread overview]
Message-ID: <20180116005719.ijy4yl3hs2wz4pug@gmail.com> (raw)
In-Reply-To: <2e58f6f0-008f-397f-8eca-f40d3d3d2e4b@redhat.com>
* Laura Abbott <labbott@redhat.com> wrote:
> On 01/13/2018 03:23 PM, Thomas Gleixner wrote:
> > The switch to the user space page tables in the low level ASM code sets
> > unconditionally bit 12 and bit 11 of CR3. Bit 12 is switching the base
> > address of the page directory to the user part, bit 11 is switching the
> > PCID to the PCID associated with the user page tables.
> >
> > This fails on a machine which lacks PCID support because bit 11 is set in
> > CR3. Bit 11 is reserved when PCID is inactive.
> >
> > While the Intel SDM claims that the reserved bits are ignored when PCID is
> > disabled, the AMD APM states that they should be cleared.
> >
> > This went unnoticed as the AMD APM was not checked when the code was
> > developed and reviewed and test systems with Intel CPUs never failed to
> > boot. The report is against a Centos 6 host where the guest fails to boot,
> > so it's not yet clear whether this is a virt issue or can happen on real
> > hardware too, but thats irrelevant as the AMD APM clearly ask for clearing
> > the reserved bits.
> >
> > Make sure that on non PCID machines bit 11 is not set by the page table
> > switching code.
> >
> > Andy suggested to rename the related bits and masks so they are clearly
> > describing what they should be used for, which is done as well for clarity.
> >
> > That split could have been done with alternatives but the macro hell is
> > horrible and ugly. This can be done on top if someone cares to remove the
> > extra orq. For now it's a straight forward fix.
> >
>
> Original reporter confirmed it fixes the problem. Thanks for the
> prompt response.
Thanks for the confirmation. Now the fix is upstream and Greg queued it up as well
earlier today, so this fix is part of the next -stable iteration as well.
Thanks,
Ingo
next prev parent reply other threads:[~2018-01-16 0:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-13 23:23 [PATCH] x86/pti: Fix !PCID and sanitize defines Thomas Gleixner
2018-01-14 9:53 ` [tip:x86/pti] " tip-bot for Thomas Gleixner
2018-01-15 15:14 ` [PATCH] " Laura Abbott
2018-01-16 0:57 ` Ingo Molnar [this message]
2018-01-16 15:59 ` Jiri Kosina
2018-01-16 17:00 ` Greg KH
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=20180116005719.ijy4yl3hs2wz4pug@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=dwmw@amazon.co.uk \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=w@1wt.eu \
--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;
as well as URLs for NNTP newsgroup(s).