From: Greg KH <gregkh@linuxfoundation.org>
To: Jane Malalane <jane.malalane@citrix.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>, Pu Wen <puwen@hygon.cn>,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Yazen Ghannam <Yazen.Ghannam@amd.com>,
Brijesh Singh <brijesh.singh@amd.com>,
Huang Rui <ray.huang@amd.com>, Andy Lutomirski <luto@kernel.org>,
Kim Phillips <kim.phillips@amd.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL
Date: Wed, 13 Oct 2021 18:46:29 +0200 [thread overview]
Message-ID: <YWcNZdyULbJG5xVA@kroah.com> (raw)
In-Reply-To: <20211013142230.10129-1-jane.malalane@citrix.com>
On Wed, Oct 13, 2021 at 03:22:30PM +0100, Jane Malalane wrote:
> Currently, Linux probes for X86_BUG_NULL_SEL unconditionally which
> makes it unsafe to migrate in a virtualised environment as the
> properties across the migration pool might differ.
>
> To be specific, the case which goes wrong is:
>
> 1. Zen1 (or earlier) and Zen2 (or later) in a migration pool
> 2. Linux boots on Zen2, probes and finds the absence of X86_BUG_NULL_SEL
> 3. Linux is then migrated to Zen1
>
> Linux is now running on a X86_BUG_NULL_SEL-impacted CPU while believing
> that the bug is fixed.
>
> The only way to address the problem is to fully trust the "no longer
> affected" CPUID bit when virtualised, because in the above case it would
> be clear deliberately to indicate the fact "you might migrate to
> somewhere which has this behaviour".
>
> Zen3 adds the NullSelectorClearsBase bit to indicate that loading
> a NULL segment selector zeroes the base and limit fields, as well as
> just attributes. Zen2 also has this behaviour but doesn't have the
> NSCB bit.
>
> Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
> ---
> CC: <x86@kernel.org>
> CC: Thomas Gleixner <tglx@linutronix.de>
> CC: Ingo Molnar <mingo@redhat.com>
> CC: Borislav Petkov <bp@alien8.de>
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: Pu Wen <puwen@hygon.cn>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Sean Christopherson <seanjc@google.com>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Yazen Ghannam <Yazen.Ghannam@amd.com>
> CC: Brijesh Singh <brijesh.singh@amd.com>
> CC: Huang Rui <ray.huang@amd.com>
> CC: Andy Lutomirski <luto@kernel.org>
> CC: Kim Phillips <kim.phillips@amd.com>
> CC: <stable@vger.kernel.org>
These need to go above the --- line, otherwise they are cut off when
the patch is applied and you will loose the cc: stable@ tag.
thanks,
greg k-h
next prev parent reply other threads:[~2021-10-13 16:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 14:22 [PATCH v2] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL Jane Malalane
2021-10-13 16:46 ` Greg KH [this message]
2021-10-18 18:17 ` Borislav Petkov
2021-10-18 19:10 ` H. Peter Anvin
2021-10-18 19:31 ` Borislav Petkov
2021-10-18 19:29 ` Sean Christopherson
2021-10-18 19:37 ` Borislav Petkov
2021-10-18 20:05 ` Sean Christopherson
2021-10-18 20:18 ` Andrew Cooper
2021-10-18 20:06 ` Andrew Cooper
2021-10-18 21:46 ` 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=YWcNZdyULbJG5xVA@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Yazen.Ghannam@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=brijesh.singh@amd.com \
--cc=hpa@zytor.com \
--cc=jane.malalane@citrix.com \
--cc=kim.phillips@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=puwen@hygon.cn \
--cc=ray.huang@amd.com \
--cc=seanjc@google.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--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