From: "Woodhouse, David" <dwmw@amazon.co.uk>
To: "jmattson@google.com" <jmattson@google.com>,
"Raslan, KarimAllah" <karahmed@amazon.de>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"arjan.van.de.ven@intel.com" <arjan.van.de.ven@intel.com>,
"ashok.raj@intel.com" <ashok.raj@intel.com>,
"tim.c.chen@linux.intel.com" <tim.c.chen@linux.intel.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"aarcange@redhat.com" <aarcange@redhat.com>,
"luto@kernel.org" <luto@kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"dave.hansen@intel.com" <dave.hansen@intel.com>,
"asit.k.mallick@intel.com" <asit.k.mallick@intel.com>,
"jun.nakajima@intel.com" <jun.nakajima@intel.com>
Subject: Re: [PATCH v4 2/5] KVM: x86: Add IBPB support
Date: Wed, 31 Jan 2018 16:57:28 +0000 [thread overview]
Message-ID: <1517417847.18619.182.camel@amazon.co.uk> (raw)
In-Reply-To: <CALMp9eRKz+sKeah0V0bpiYJJUgTM5oisbtahkNGtW=seW2W5JQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1688 bytes --]
On Wed, 2018-01-31 at 08:50 -0800, Jim Mattson wrote:
> On Wed, Jan 31, 2018 at 5:10 AM, KarimAllah Ahmed <karahmed@amazon.de> wrote:
>
> >
> > + vmx_disable_intercept_for_msr(vmx->vmcs01.msr_bitmap, MSR_IA32_PRED_CMD,
> > + MSR_TYPE_W);
> Why not disable this intercept eagerly, rather than lazily? Unlike
> MSR_IA32_SPEC_CTRL, there is no guest value to save/restore, so there
> is no cost to disabling the intercept if the guest cpuid info declares
> support for it.
The original patch did that, but the problem was that the guest CPU
features weren't known yet so it was done based on boot_cpu_has(),
which isn't right either.
By doing it on first access, we can make it just like the SPEC_CTRL one
which can indeed use guest_cpu_has().
>
> >
> > + 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)"?
Right... we don't even *have* save_spec_ctrl_on_exit in this patch yet,
do we? That's added in a later patch... for spec_ctrl.
> Also, the final argument to
> nested_vmx_disable_intercept_for_msr should be MSR_TYPE_W rather than
> MSR_TYPE_R.
>
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5210 bytes --]
[-- Attachment #2.1: Type: text/plain, Size: 197 bytes --]
Amazon Web Services UK Limited. Registered in England and Wales with registration number 08650665 and which has its registered office at 60 Holborn Viaduct, London EC1A 2FD, United Kingdom.
[-- Attachment #2.2: Type: text/html, Size: 197 bytes --]
next prev parent reply other threads:[~2018-01-31 16:57 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
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 [this message]
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=1517417847.18619.182.camel@amazon.co.uk \
--to=dwmw@amazon.co.uk \
--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=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®