mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Jim Mattson <jmattson@google.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Liran Alon" <liran.alon@oracle.com>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	dwmw@amazon.co.uk, "Borislav Petkov" <bp@alien8.de>,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"kvm list" <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/8] kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest
Date: Fri, 12 Jan 2018 15:19:50 -0800	[thread overview]
Message-ID: <677CE8BB-5502-45C5-8277-25D982E45951@gmail.com> (raw)
In-Reply-To: <CALMp9eThy8ZpzPJjWRVikmZxUdgbP7Km0tOBOXo20bxNuKxdQw@mail.gmail.com>

Thanks, Jim. Highly appreciated.

Jim Mattson <jmattson@google.com> wrote:

> Nadav,
> 
> See section 2.5.1.2 (paragraph 3) in
> https://software.intel.com/sites/default/files/managed/c5/63/336996-Speculative-Execution-Side-Channel-Mitigations.pdf.
> 
> On Tue, Jan 9, 2018 at 9:03 PM, Nadav Amit <nadav.amit@gmail.com> wrote:
>> Paolo Bonzini <pbonzini@redhat.com> wrote:
>> 
>>> On 09/01/2018 17:48, Liran Alon wrote:
>>>>>> +  if (have_spec_ctrl) {
>>>>>> +          rdmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl);
>>>>>> +          if (vmx->spec_ctrl != 0)
>>>>>> +                  wrmsrl(MSR_IA32_SPEC_CTRL, 0);
>>>> 
>>>> As I said also on the AMD patch, I think this is a bug.
>>>> Intel specify that we should set IBRS bit even if it was already set on every #VMExit.
>>> 
>>> That's correct (though I'd like to understand _why_---I'm not inclined
>>> to blindly trust a spec), but for now it's saving a wrmsr of 0.  That is
>>> quite obviously okay, and will be also okay after the bare-metal IBRS
>>> patches.
>>> 
>>> Of course the code will become something like
>>> 
>>>      if (using_ibrs || vmx->spec_ctrl != 0)
>>>              wrmsrl(MSR_IA32_SPEC_CTRL, host_ibrs);
>>> 
>>> optimizing the case where the host is using retpolines.
>> 
>> Excuse my ignorance: Can you point me to the specifications that mention “we
>> should set IBRS bit even if it was already set on every #VMExit” ?
>> 
>> Thanks,
>> Nadav

  reply	other threads:[~2018-01-12 23:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 16:48 Liran Alon
2018-01-09 16:57 ` Paolo Bonzini
2018-01-10  5:03   ` Nadav Amit
2018-01-10 13:20     ` Paolo Bonzini
2018-01-10 14:06       ` Arjan van de Ven
2018-01-10 14:28         ` Paolo Bonzini
2018-01-10 15:41           ` Konrad Rzeszutek Wilk
2018-01-10 15:45             ` Paolo Bonzini
2018-01-10 15:48             ` Woodhouse, David
2018-01-10 15:56               ` Paolo Bonzini
2018-01-10 16:05                 ` David Woodhouse
2018-01-12 23:17     ` Jim Mattson
2018-01-12 23:19       ` Nadav Amit [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-10 16:51 Liran Alon
2018-01-10 17:07 ` David Woodhouse
2018-01-10 16:19 Liran Alon
2018-01-10 16:27 ` Paolo Bonzini
2018-01-10 17:14   ` Jim Mattson
2018-01-10 17:16     ` Paolo Bonzini
2018-01-10 17:23       ` Nadav Amit
2018-01-10 17:32         ` Jim Mattson
2018-01-10 16:47 ` David Woodhouse
2018-01-10  0:33 Liran Alon
2018-01-09 16:06 Liran Alon
2018-01-09 12:03 [PATCH v2 0/8] KVM: x86: expose CVE-2017-5715 ("Spectre variant 2") mitigations to guest Paolo Bonzini
2018-01-09 12:03 ` [PATCH 3/8] kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest Paolo Bonzini
2018-01-13 10:16   ` Longpeng (Mike)
2018-01-15  9:23     ` Paolo Bonzini
2018-01-15  9:34       ` Thomas Gleixner

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=677CE8BB-5502-45C5-8277-25D982E45951@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=aliguori@amazon.com \
    --cc=bp@alien8.de \
    --cc=dwmw@amazon.co.uk \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liran.alon@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=thomas.lendacky@amd.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®