LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Borislav Petkov <bp@alien8.de>, 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>, "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>,
	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] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL
Date: Wed, 6 Oct 2021 15:15:51 +0100	[thread overview]
Message-ID: <c2d96a84-64d2-b4b4-261d-e98612552ba0@citrix.com> (raw)
In-Reply-To: <YVcZCgOVkCPz1kwO@zn.tnic>

On 01/10/2021 15:19, Borislav Petkov wrote:
> On Fri, Oct 01, 2021 at 02:33:49PM +0100, Jane Malalane wrote:
>> Subject: Re: [PATCH] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL
>> ...
>> 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.
> Sorry but you need to explain "migration safety" in greater detail -
> we're not all virtualizers.

The case which goes wrong is this:

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 really is affected".

~Andrew


  reply	other threads:[~2021-10-06 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 13:33 Jane Malalane
2021-10-01 14:07 ` Andrew Cooper
2021-10-01 14:19 ` Borislav Petkov
2021-10-06 14:15   ` Andrew Cooper [this message]
2021-10-06 14:30     ` Borislav Petkov
2021-10-05 20:58 ` Andy Lutomirski

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=c2d96a84-64d2-b4b4-261d-e98612552ba0@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Yazen.Ghannam@amd.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 \
    --subject='Re: [PATCH] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL' \
    /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

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).