From: KarimAllah Ahmed <karahmed@amazon.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Jim Mattson <jmattson@google.com>,
KarimAllah Ahmed <karahmed@amazon.de>
Cc: the arch/x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
kvm list <kvm@vger.kernel.org>, Ashok Raj <ashok.raj@intel.com>,
Asit Mallick <asit.k.mallick@intel.com>,
Dave Hansen <dave.hansen@intel.com>,
Arjan Van De Ven <arjan.van.de.ven@intel.com>,
"Tim Chen" <tim.c.chen@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrea Arcangeli <aarcange@redhat.com>,
"Andi Kleen" <ak@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
"Dan Williams" <dan.j.williams@intel.com>,
Jun Nakajima <jun.nakajima@intel.com>,
Andy Lutomirski <luto@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Peter Zijlstra <peterz@infradead.org>,
David Woodhouse <dwmw@amazon.co.uk>
Subject: Re: [PATCH v4 2/5] KVM: x86: Add IBPB support
Date: Wed, 31 Jan 2018 18:17:04 +0100 [thread overview]
Message-ID: <4c3f3acf-b07b-cb6a-8ca1-e850980eda0d@amazon.com> (raw)
In-Reply-To: <7dbf6cad-f03d-640c-bc95-d82deaa30cb7@redhat.com>
On 01/31/2018 05:55 PM, Paolo Bonzini wrote:
> On 31/01/2018 11:50, Jim Mattson wrote:
>>> + if (to_vmx(vcpu)->save_spec_ctrl_on_exit) {
>>> + nested_vmx_disable_intercept_for_msr(
>>> + msr_bitmap_l1, msr_bitmap_l0,
>>> + MSR_IA32_PRED_CMD,
>>> + MSR_TYPE_R);
>>> + }
>> I don't think this should be predicated on
>> "to_vmx(vcpu)->save_spec_ctrl_on_exit." Why not just
>> "guest_cpuid_has(vcpu, X86_FEATURE_IBPB)"? Also, the final argument to
>> nested_vmx_disable_intercept_for_msr should be MSR_TYPE_W rather than
>> MSR_TYPE_R.
>
> In fact this MSR can even be passed down unconditionally, since it needs
> no save/restore and has no ill performance effect on the sibling
> hyperthread.
>
> Only MSR_IA32_SPEC_CTRL needs to be conditional on
> "to_vmx(vcpu)->save_spec_ctrl_on_exit".
That used to be the case in an earlier version. There seems to be two
opinions here:
1) Pass it only if CPUID for the guest has it.
2) Pass it unconditionally.
I do not really have a preference.
>
> Paolo
>
Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
next prev parent reply other threads:[~2018-01-31 17:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 13:10 [PATCH v4 0/5] KVM: Expose speculation control feature to guests KarimAllah Ahmed
2018-01-31 13:10 ` [PATCH v4 1/5] KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDX KarimAllah Ahmed
2018-01-31 13:10 ` [PATCH v4 2/5] KVM: x86: Add IBPB support KarimAllah Ahmed
2018-01-31 16:50 ` Jim Mattson
2018-01-31 16:55 ` Paolo Bonzini
2018-01-31 17:17 ` KarimAllah Ahmed [this message]
2018-01-31 17:39 ` Jim Mattson
2018-01-31 18:04 ` Van De Ven, Arjan
2018-01-31 18:53 ` Paolo Bonzini
2018-01-31 16:57 ` Woodhouse, David
2018-01-31 17:11 ` KarimAllah Ahmed
2018-01-31 17:15 ` Paolo Bonzini
2018-01-31 17:32 ` Paolo Bonzini
2018-01-31 13:10 ` [PATCH v4 3/5] KVM: VMX: Emulate MSR_IA32_ARCH_CAPABILITIES KarimAllah Ahmed
2018-01-31 13:10 ` [PATCH v4 4/5] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL KarimAllah Ahmed
2018-01-31 13:10 ` [PATCH v4 5/5] KVM: SVM: " KarimAllah Ahmed
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=4c3f3acf-b07b-cb6a-8ca1-e850980eda0d@amazon.com \
--to=karahmed@amazon.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=arjan.van.de.ven@intel.com \
--cc=ashok.raj@intel.com \
--cc=asit.k.mallick@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=dwmw@amazon.co.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jmattson@google.com \
--cc=jun.nakajima@intel.com \
--cc=karahmed@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--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
all inboxes | Powered by JetHome®