From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Wanpeng Li" <kernellwp@gmail.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Yunhong Jiang" <yunhong.jiang@intel.com>,
"Jan Kiszka" <jan.kiszka@siemens.com>,
"Haozhong Zhang" <haozhong.zhang@intel.com>
Subject: [RFT PATCH v5 2/3] KVM: VMX: reflect broken preemption timer in vmcs_config
Date: Fri, 8 Jul 2016 14:02:12 +0200 [thread overview]
Message-ID: <1467979333-19535-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1467979333-19535-1-git-send-email-pbonzini@redhat.com>
Simplify cpu_has_vmx_preemption_timer. This is consistent with the
rest of setup_vmcs_config and preparatory for the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
arch/x86/kvm/vmx.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f6e5cc679898..0048be79c7b9 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1121,9 +1121,6 @@ static inline bool cpu_has_broken_vmx_preemption_timer(void)
static inline bool cpu_has_vmx_preemption_timer(void)
{
- if (cpu_has_broken_vmx_preemption_timer())
- return false;
-
return vmcs_config.pin_based_exec_ctrl &
PIN_BASED_VMX_PREEMPTION_TIMER;
}
@@ -3407,6 +3404,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
&_pin_based_exec_control) < 0)
return -EIO;
+ if (cpu_has_broken_vmx_preemption_timer())
+ _pin_based_exec_control &= ~PIN_BASED_VMX_PREEMPTION_TIMER;
if (!(_cpu_based_2nd_exec_control &
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY))
_pin_based_exec_control &= ~PIN_BASED_POSTED_INTR;
--
1.8.3.1
next prev parent reply other threads:[~2016-07-08 12:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-08 12:02 [RFT PATCH v5 0/3] Fix preemption timer optimization while nested guests run Paolo Bonzini
2016-07-08 12:02 ` [RFT PATCH v5 1/3] KVM: nVMX: avoid incorrect preemption timer vmexit in nested guest Paolo Bonzini
2016-07-08 12:02 ` Paolo Bonzini [this message]
2016-07-08 12:02 ` [RFT PATCH v5 3/3] KVM: nVMX: keep preemption timer enabled during L2 execution Paolo Bonzini
2016-07-08 17:29 ` yunhong jiang
2016-07-08 17:41 ` Paolo Bonzini
2016-07-08 21:30 ` yunhong jiang
2016-07-08 21:39 ` Paolo Bonzini
2016-07-08 23:18 ` yunhong jiang
2016-07-11 4:56 ` [RFT PATCH v5 0/3] Fix preemption timer optimization while nested guests run Wanpeng Li
2016-07-11 7:29 ` 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=1467979333-19535-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=haozhong.zhang@intel.com \
--cc=jan.kiszka@siemens.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=yunhong.jiang@intel.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®