kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	david@redhat.com
Subject: [PATCH v2 08/15] KVM: VMX: require INVEPT GLOBAL for EPT
Date: Thu, 24 Aug 2017 20:51:30 +0200	[thread overview]
Message-ID: <20170824185137.6253-9-david@redhat.com> (raw)
In-Reply-To: <20170824185137.6253-1-david@redhat.com>

Without this, we won't be able to do any flushes, so let's just require
it. Should be absent in very strange configurations.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 arch/x86/kvm/vmx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ad5775ca8349..a5a5e517cf65 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1592,8 +1592,7 @@ static inline void vpid_sync_context(int vpid)
 
 static inline void ept_sync_global(void)
 {
-	if (cpu_has_vmx_invept_global())
-		__invept(VMX_EPT_EXTENT_GLOBAL, 0, 0);
+	__invept(VMX_EPT_EXTENT_GLOBAL, 0, 0);
 }
 
 static inline void ept_sync_context(u64 eptp)
@@ -6638,7 +6637,8 @@ static __init int hardware_setup(void)
 
 	if (!cpu_has_vmx_ept() ||
 	    !cpu_has_vmx_ept_4levels() ||
-	    !cpu_has_vmx_ept_mt_wb()) {
+	    !cpu_has_vmx_ept_mt_wb() ||
+	    !cpu_has_vmx_invept_global()) {
 		enable_ept = 0;
 		enable_unrestricted_guest = 0;
 		enable_ept_ad_bits = 0;
-- 
2.13.5

  parent reply	other threads:[~2017-08-24 18:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 18:51 [PATCH v2 00/15] KVM x86/VMX cleanups David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 01/15] KVM: x86: mmu: returning void in a void function is strange David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 02/15] KVM: x86: mmu: free_page can handle NULL David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 03/15] KVM: x86: drop BUG_ON(vcpu->kvm) David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 04/15] KVM: VMX: vmx_vcpu_setup() cannot fail David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 05/15] KVM: x86: no need to inititalize vcpu members to 0 David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 06/15] KVM: VMX: drop enable_ept check from ept_sync_context() David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 07/15] KVM: VMX: call ept_sync_global() with enable_ept only David Hildenbrand
2017-08-24 18:51 ` David Hildenbrand [this message]
2017-08-24 18:51 ` [PATCH v2 09/15] KVM: VMX: drop unnecessary function declarations David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 10/15] KVM: nVMX: no need to set vcpu->cpu when switching vmcs David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 11/15] KVM: nVMX: no need to set ept/vpid caps to 0 David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 12/15] KVM: VMX: cleanup init_rmode_identity_map() David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 13/15] KVM: x86: document special identity map address value David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 14/15] KVM: x86: allow setting identity map addr with no vcpus only David Hildenbrand
2017-08-24 18:51 ` [PATCH v2 15/15] KVM: VMX: rename RDSEED and RDRAND vmx ctrls to reflect exiting David Hildenbrand
2017-08-24 20:39   ` Jim Mattson
2017-08-28 14:55     ` David Hildenbrand
2017-08-28 15:50       ` Jim Mattson
2017-09-19 12:42 ` [PATCH v2 00/15] KVM x86/VMX cleanups David Hildenbrand
2017-09-19 12:57   ` Paolo Bonzini
2017-10-06 18:11 ` Radim Krčmář

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=20170824185137.6253-9-david@redhat.com \
    --to=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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;
as well as URLs for NNTP newsgroup(s).