mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Kohler <jon@nutanix.com>
To: Jim Mattson <jmattson@google.com>
Cc: Jon Kohler <jon@nutanix.com>,
	Sean Christopherson <seanjc@google.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	X86 ML <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Kees Cook <keescook@chromium.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Kim Phillips <kim.phillips@amd.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ashok Raj <ashok.raj@intel.com>,
	KarimAllah Ahmed <karahmed@amazon.de>,
	David Woodhouse <dwmw@amazon.co.uk>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"kvm @ vger . kernel . org" <kvm@vger.kernel.org>,
	Waiman Long <longman@redhat.com>
Subject: Re: [PATCH v4] x86/speculation, KVM: remove IBPB on vCPU load
Date: Fri, 13 May 2022 03:19:08 +0000	[thread overview]
Message-ID: <CD2EB6FA-E17F-45BA-AC70-92CCB12A16C4@nutanix.com> (raw)
In-Reply-To: <CALMp9eTwH9WVD=EuTXeu1KYAkAUuXdnmA+k9dti7OM+u=kLKHQ@mail.gmail.com>



> On May 12, 2022, at 11:06 PM, Jim Mattson <jmattson@google.com> wrote:
> 
> On Thu, May 12, 2022 at 5:50 PM Jon Kohler <jon@nutanix.com> wrote:
> 
>> You mentioned if someone was concerned about performance, are you
>> saying they also critically care about performance, such that they are
>> willing to *not* use IBPB at all, and instead just use taskset and hope
>> nothing ever gets scheduled on there, and then hope that the hypervisor
>> does the job for them?
> 
> I am saying that IBPB is not the only viable mitigation for
> cross-process indirect branch steering. Proper scheduling can also
> solve the problem, without the overhead of IBPB. Say that you have two
> security domains: trusted and untrusted. If you have a two-socket
> system, and you always run trusted workloads on socket#0 and untrusted
> workloads on socket#1, IBPB is completely superfluous. However, if the
> hypervisor chooses to schedule a vCPU thread from virtual socket#0
> after a vCPU thread from virtual socket#1 on the same logical
> processor, then it *must* execute an IBPB between those two vCPU
> threads. Otherwise, it has introduced a non-architectural
> vulnerability that the guest can't possibly be aware of.
> 
> If you can't trust your OS to schedule tasks where you tell it to
> schedule them, can you really trust it to provide you with any kind of
> inter-process security?

Fair enough, so going forward:
Should this be mandatory in all cases? How this whole effort came
was that a user could configure their KVM host with conditional
IBPB, but this particular mitigation is now always on no matter what.

In our previous patch review threads, Sean and I mostly settled on making
this particular avenue active only when a user configures always_ibpb, such
that for cases like the one you describe (and others like it that come up in
the future) can be covered easily, but for cond_ibpb, we can document
that it doesn’t cover this case. 

Would that be acceptable here?

> 
>> Would this be the expectation of just KVM? Or all hypervisors on the
>> market?
> 
> Any hypervisor that doesn't do this is broken, but that won't keep it
> off the market. :-)

Very true :)


  reply	other threads:[~2022-05-13  3:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 18:45 Jon Kohler
2022-05-12 19:27 ` Sean Christopherson
2022-05-12 19:35   ` Sean Christopherson
2022-05-12 19:51     ` Jon Kohler
2022-05-12 20:06       ` Jim Mattson
2022-05-12 20:07       ` Sean Christopherson
2022-05-12 20:27         ` Jim Mattson
2022-05-12 20:33           ` Jon Kohler
2022-05-12 23:57             ` Jim Mattson
2022-05-13  0:50               ` Jon Kohler
2022-05-13  3:06                 ` Jim Mattson
2022-05-13  3:19                   ` Jon Kohler [this message]
2022-05-13  3:50                     ` Jim Mattson
2022-05-13 15:21                       ` Jon Kohler
2022-05-13 19:36                         ` Jim Mattson
2022-05-12 20:31         ` Jon Kohler

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=CD2EB6FA-E17F-45BA-AC70-92CCB12A16C4@nutanix.com \
    --to=jon@nutanix.com \
    --cc=aarcange@redhat.com \
    --cc=ashok.raj@intel.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=jpoimboe@redhat.com \
    --cc=karahmed@amazon.de \
    --cc=keescook@chromium.org \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=lukas.bulwahn@gmail.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --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®