public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>, "Raj, Ashok" <ashok.raj@intel.com>
Cc: "KarimAllah Ahmed" <karahmed@amazon.de>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, "Andi Kleen" <ak@linux.intel.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Arjan van de Ven" <arjan@linux.intel.com>,
	"Asit Mallick" <asit.k.mallick@intel.com>,
	"Borislav Petkov" <bp@suse.de>,
	"Dan Williams" <dan.j.williams@intel.com>,
	"Dave Hansen" <dave.hansen@intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Janakarajan Natarajan" <Janakarajan.Natarajan@amd.com>,
	"Joerg Roedel" <joro@8bytes.org>,
	"Jun Nakajima" <jun.nakajima@intel.com>,
	"Laura Abbott" <labbott@redhat.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Tim Chen" <tim.c.chen@linux.intel.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>
Subject: Re: [PATCH v3 0/4] KVM: Expose speculation control feature to guests
Date: Wed, 31 Jan 2018 00:26:22 +0000	[thread overview]
Message-ID: <1517358382.18619.149.camel@infradead.org> (raw)
In-Reply-To: <ee39e670-c5da-bde9-dd27-34c99c7a12ae@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]



On Tue, 2018-01-30 at 19:16 -0500, Paolo Bonzini wrote:
> On 30/01/2018 18:48, Raj, Ashok wrote:
> > 
> > > 
> > > Certainly not every vmexit!  But doing it on every userspace vmexit and
> > > every sched_out would not be *that* bad.
> > Right.. agreed. We discussed the different scenarios that doing IBPB
> > on VMexit would help, and decided its really not required on every exit. 
> > 
> > One obvious case is when there is a VMexit and return back to Qemu
> > process (witout a real context switch) do we need that to be 
> > protected from any poisoned BTB from guest?
> If the host is using retpolines, then some kind of barrier is needed.  I
> don't know if the full PRED_CMD barrier is needed, or two IBRS=1/IBRS=0
> writes back-to-back are enough.
> 
> If the host is using IBRS, then writing IBRS=1 at vmexit has established
> a barrier from the less privileged VMX guest environment.

IBRS will protect qemu userspace only if you set it at some point
before exiting the kernel. You don't want it set *in* the kernel, if
we're using retpolines in the kernel, so you'd want to clear it again
on the way back into the kernel. It's almost the opposite of what the
IBRS patch set was doing to protect the kernel.

Just use IBPB :)

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5213 bytes --]

  reply	other threads:[~2018-01-31  0:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30  0:10 [PATCH v3 0/4] KVM: Expose speculation control feature to guests KarimAllah Ahmed
2018-01-30  0:10 ` [PATCH v3 1/4] KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDX KarimAllah Ahmed
2018-01-30 23:17   ` Paolo Bonzini
2018-01-30  0:10 ` [PATCH v3 2/4] KVM: x86: Add IBPB support KarimAllah Ahmed
2018-01-30 14:22   ` Tom Lendacky
2018-01-30 14:36     ` David Woodhouse
2018-01-30 17:19   ` Jim Mattson
2018-01-30 17:43     ` David Woodhouse
2018-01-30  0:10 ` [PATCH v3 3/4] KVM: VMX: Emulate MSR_IA32_ARCH_CAPABILITIES KarimAllah Ahmed
2018-01-30  0:22   ` Raj, Ashok
2018-01-30  0:25     ` KarimAllah Ahmed
2018-01-30 23:21       ` Paolo Bonzini
2018-01-30  0:10 ` [PATCH v3 4/4] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL KarimAllah Ahmed
2018-01-30 17:49   ` Jim Mattson
2018-01-30 21:00     ` KarimAllah Ahmed
2018-01-30 22:49       ` Jim Mattson
2018-01-30 23:32         ` Paolo Bonzini
2018-01-30 23:50         ` KarimAllah Ahmed
2018-01-31  0:16           ` Jim Mattson
2018-01-31  0:19           ` Paolo Bonzini
2018-01-31  0:27             ` Jim Mattson
2018-01-31  0:52               ` KarimAllah Ahmed
2018-01-31  0:56               ` Paolo Bonzini
2018-01-30  9:00 ` [PATCH v3 0/4] KVM: Expose speculation control feature to guests David Woodhouse
2018-01-30  9:32   ` KarimAllah Ahmed
2018-01-30 23:36   ` Paolo Bonzini
2018-01-30 23:48     ` Raj, Ashok
2018-01-31  0:16       ` Paolo Bonzini
2018-01-31  0:26         ` David Woodhouse [this message]
2018-01-31  6:54         ` Dave Hansen

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=1517358382.18619.149.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=Janakarajan.Natarajan@amd.com \
    --cc=aarcange@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=arjan@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=bp@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=jun.nakajima@intel.com \
    --cc=karahmed@amazon.de \
    --cc=kvm@vger.kernel.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.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