public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jim Mattson <jmattson@google.com>
To: kvm@vger.kernel.org, pbonzini@redhat.com, seanjc@google.com
Cc: Jim Mattson <jmattson@google.com>
Subject: [PATCH v2 1/2] KVM: VMX: Guest usage of IA32_SPEC_CTRL is likely
Date: Wed, 19 Oct 2022 14:36:19 -0700	[thread overview]
Message-ID: <20221019213620.1953281-2-jmattson@google.com> (raw)
In-Reply-To: <20221019213620.1953281-1-jmattson@google.com>

At this point in time, most guests (in the default, out-of-the-box
configuration) are likely to use IA32_SPEC_CTRL.  Therefore, drop the
compiler hint that it is unlikely for KVM to be intercepting WRMSR of
IA32_SPEC_CTRL.

Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 9dba04b6b019..b092f61b8258 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -858,7 +858,7 @@ unsigned int __vmx_vcpu_run_flags(struct vcpu_vmx *vmx)
 	 * to change it directly without causing a vmexit.  In that case read
 	 * it after vmexit and store it in vmx->spec_ctrl.
 	 */
-	if (unlikely(!msr_write_intercepted(vmx, MSR_IA32_SPEC_CTRL)))
+	if (!msr_write_intercepted(vmx, MSR_IA32_SPEC_CTRL))
 		flags |= VMX_RUN_SAVE_SPEC_CTRL;
 
 	return flags;
-- 
2.38.0.413.g74048e4d9e-goog


  reply	other threads:[~2022-10-19 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 21:36 [PATCH v2 0/2] KVM: nVMX: Add IBPB between L2 and L1 to Jim Mattson
2022-10-19 21:36 ` Jim Mattson [this message]
2022-11-01 19:23   ` [PATCH v2 1/2] KVM: VMX: Guest usage of IA32_SPEC_CTRL is likely Sean Christopherson
2022-10-19 21:36 ` [PATCH v2 2/2] KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS Jim Mattson
2022-11-01 19:23   ` Sean Christopherson
2022-11-01 18:50 ` [PATCH v2 0/2] KVM: nVMX: Add IBPB between L2 and L1 to Jim Mattson
2022-12-02 19:21 ` Sean Christopherson

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=20221019213620.1953281-2-jmattson@google.com \
    --to=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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