From: Paolo Bonzini <pbonzini@redhat.com>
To: Liran Alon <liran.alon@oracle.com>
Cc: jmattson@google.com, bp@alien8.de, thomas.lendacky@amd.com,
aliguori@amazon.com, linux-kernel@vger.kernel.org,
dwmw2@infradead.org, kvm@vger.kernel.org
Subject: Re: [PATCH 3/7] kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest
Date: Tue, 9 Jan 2018 09:35:46 +0100 [thread overview]
Message-ID: <28c42666-4403-578b-a0c5-d9ccd111f028@redhat.com> (raw)
In-Reply-To: <751eaab5-1cc1-4913-b3c7-379255140cd1@default>
On 09/01/2018 00:58, Liran Alon wrote:
>
> ----- pbonzini@redhat.com wrote:
>
>> ----- Original Message -----
>>> From: "David Woodhouse" <dwmw2@infradead.org>
>>> To: "Paolo Bonzini" <pbonzini@redhat.com>,
>> linux-kernel@vger.kernel.org, kvm@vger.kernel.org
>>> Cc: jmattson@google.com, aliguori@amazon.com, "thomas lendacky"
>> <thomas.lendacky@amd.com>, bp@alien8.de
>>> Sent: Monday, January 8, 2018 8:41:07 PM
>>> Subject: Re: [PATCH 3/7] kvm: vmx: pass MSR_IA32_SPEC_CTRL and
>> MSR_IA32_PRED_CMD down to the guest
>>>
>>> On Mon, 2018-01-08 at 19:08 +0100, Paolo Bonzini wrote:
>>>>
>>>> + if (have_spec_ctrl && vmx->spec_ctrl != 0)
>>>> + wrmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl);
>>>> +
>>>
>>> I think this one probably *is* safe even without an 'else lfence',
>>> which means that the CPU can speculate around it, but it wants a
>>> comment explaining that someone has properly analysed it and saying
>>> precisely why.
>>
>> This one is okay as long as there are no indirect jumps until
>> vmresume. But the one on vmexit is only okay because right now
>> it's *disabling* IBRS. Once IBRS is used by Linux, we'll need an
>> lfence there. I'll add a comment.
>>
>> Paolo
>
> That is true but from what I understand, there is an indirect branch from this point until vmresume.
> That indirect branch resides in atomic_switch_perf_msrs() immediately called after this WRMSR:
> atomic_switch_perf_msrs() -> perf_guest_get_msrs() -> x86_pmu.guest_get_msrs().
Sure, it has to move later as pointed out by other reviewers.
Paolo
next prev parent reply other threads:[~2018-01-09 8:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 23:58 Liran Alon
2018-01-09 8:35 ` Paolo Bonzini [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-01-08 18:08 [PATCH 0/7] KVM: x86: expose CVE-2017-5715 ("Spectre variant 2") mitigations to guest Paolo Bonzini
2018-01-08 18:08 ` [PATCH 3/7] kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest Paolo Bonzini
2018-01-08 18:43 ` Konrad Rzeszutek Wilk
2018-01-08 19:18 ` Jim Mattson
2018-01-08 20:23 ` Liran Alon
2018-01-08 22:32 ` Paolo Bonzini
2018-01-08 23:19 ` Jim Mattson
2018-01-09 10:11 ` Paolo Bonzini
2018-01-08 19:22 ` Liran Alon
2018-01-08 19:41 ` David Woodhouse
2018-01-08 22:33 ` Paolo Bonzini
2018-01-08 22:09 ` Ashok Raj
2018-01-08 22:25 ` Paolo Bonzini
2018-01-11 2:47 ` Tim Chen
2018-01-11 10:41 ` Paolo Bonzini
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=28c42666-4403-578b-a0c5-d9ccd111f028@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@amazon.com \
--cc=bp@alien8.de \
--cc=dwmw2@infradead.org \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liran.alon@oracle.com \
--cc=thomas.lendacky@amd.com \
/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®