All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com, sheng.yang@intel.com,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 1/5] KVM: VMX: more MSR_IA32_VMX_EPT_VPID_CAP capability bits
Date: Tue, 09 Jun 2009 18:30:10 -0300	[thread overview]
Message-ID: <20090609213312.653450055@amt.cnet> (raw)
In-Reply-To: 20090609213009.436123773@amt.cnet

[-- Attachment #1: vmx-ept-check-supported-bits --]
[-- Type: text/plain, Size: 1763 bytes --]

Required for EPT misconfiguration handler.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Index: kvm/arch/x86/include/asm/vmx.h
===================================================================
--- kvm.orig/arch/x86/include/asm/vmx.h
+++ kvm/arch/x86/include/asm/vmx.h
@@ -351,9 +351,16 @@ enum vmcs_field {
 #define VMX_EPT_EXTENT_INDIVIDUAL_ADDR		0
 #define VMX_EPT_EXTENT_CONTEXT			1
 #define VMX_EPT_EXTENT_GLOBAL			2
+
+#define VMX_EPT_EXECUTE_ONLY_BIT		(1ull)
+#define VMX_EPT_PAGE_WALK_4_BIT			(1ull << 6)
+#define VMX_EPTP_UC_BIT				(1ull << 8)
+#define VMX_EPTP_WB_BIT				(1ull << 14)
+#define VMX_EPT_2MB_PAGE_BIT			(1ull << 16)
 #define VMX_EPT_EXTENT_INDIVIDUAL_BIT		(1ull << 24)
 #define VMX_EPT_EXTENT_CONTEXT_BIT		(1ull << 25)
 #define VMX_EPT_EXTENT_GLOBAL_BIT		(1ull << 26)
+
 #define VMX_EPT_DEFAULT_GAW			3
 #define VMX_EPT_MAX_GAW				0x4
 #define VMX_EPT_MT_EPTE_SHIFT			3
Index: kvm/arch/x86/kvm/vmx.c
===================================================================
--- kvm.orig/arch/x86/kvm/vmx.c
+++ kvm/arch/x86/kvm/vmx.c
@@ -258,6 +258,26 @@ static inline bool cpu_has_vmx_flexprior
 		cpu_has_vmx_virtualize_apic_accesses();
 }
 
+static inline bool cpu_has_vmx_ept_execute_only(void)
+{
+	return !!(vmx_capability.ept & VMX_EPT_EXECUTE_ONLY_BIT);
+}
+
+static inline bool cpu_has_vmx_eptp_uncacheable(void)
+{
+	return !!(vmx_capability.ept & VMX_EPTP_UC_BIT);
+}
+
+static inline bool cpu_has_vmx_eptp_writeback(void)
+{
+	return !!(vmx_capability.ept & VMX_EPTP_WB_BIT);
+}
+
+static inline bool cpu_has_vmx_ept_2m_page(void)
+{
+	return !!(vmx_capability.ept & VMX_EPT_2MB_PAGE_BIT);
+}
+
 static inline int cpu_has_vmx_invept_individual_addr(void)
 {
 	return !!(vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT);



  reply	other threads:[~2009-06-09 21:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 21:30 [patch 0/5] VMX EPT misconfigurtion handler Marcelo Tosatti
2009-06-09 21:30 ` Marcelo Tosatti [this message]
2009-06-09 21:30 ` [patch 2/5] KVM: MMU: make for_each_shadow_entry aware of largepages Marcelo Tosatti
2009-06-10  9:15   ` Avi Kivity
2009-06-10  9:21     ` Avi Kivity
2009-06-11 12:38       ` Marcelo Tosatti
2009-06-11 14:17         ` Avi Kivity
2009-06-09 21:30 ` [patch 3/5] KVM: MMU: add kvm_mmu_shadow_walk helper Marcelo Tosatti
2009-06-10  9:17   ` Avi Kivity
2009-06-10 12:14     ` Marcelo Tosatti
2009-06-10 12:23       ` Avi Kivity
2009-06-10 13:17         ` Marcelo Tosatti
2009-06-10 15:24           ` Avi Kivity
2009-06-11  3:20             ` Avi Kivity
2009-06-11 14:02               ` [patch 0/5] VMX EPT misconfiguration handler v2 Marcelo Tosatti
2009-06-11 14:02               ` [patch 1/5] KVM: VMX: more MSR_IA32_VMX_EPT_VPID_CAP capability bits Marcelo Tosatti
2009-06-11 14:02               ` [patch 2/5] KVM: MMU: make for_each_shadow_entry aware of largepages Marcelo Tosatti
2009-06-11 14:02               ` [patch 3/5] KVM: MMU: add kvm_mmu_get_spte_hierarchy helper Marcelo Tosatti
2009-06-11 14:31                 ` Avi Kivity
2009-06-11 15:07                   ` [patch 0/5] VMX EPT misconfiguration handler v3 Marcelo Tosatti
2009-06-14  9:54                     ` Avi Kivity
2009-06-11 15:07                   ` [patch 1/5] KVM: VMX: more MSR_IA32_VMX_EPT_VPID_CAP capability bits Marcelo Tosatti
2009-06-11 15:07                   ` [patch 2/5] KVM: MMU: make for_each_shadow_entry aware of largepages Marcelo Tosatti
2009-06-11 15:07                   ` [patch 3/5] KVM: MMU: add kvm_mmu_get_spte_hierarchy helper Marcelo Tosatti
2009-06-11 15:07                   ` [patch 4/5] KVM: VMX: EPT misconfiguration handler Marcelo Tosatti
2009-06-11 15:07                   ` [patch 5/5] KVM: VMX: conditionally disable 2M pages Marcelo Tosatti
2009-06-11 14:02               ` [patch 4/5] KVM: VMX: EPT misconfiguration handler Marcelo Tosatti
2009-06-11 14:02               ` [patch 5/5] KVM: VMX: conditionally disable 2M pages Marcelo Tosatti
2009-06-09 21:30 ` [patch 4/5] KVM: VMX: EPT misconfiguration handler Marcelo Tosatti
2009-06-09 21:30 ` [patch 5/5] KVM: VMX: conditionally disable 2M pages Marcelo Tosatti
2009-06-10  9:18   ` Avi Kivity
2009-06-10  9:13 ` [patch 0/5] VMX EPT misconfigurtion handler Yang, Sheng

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=20090609213312.653450055@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng.yang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.