public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 09/47] KVM: VMX: more MSR_IA32_VMX_EPT_VPID_CAP capability bits
Date: Wed, 19 Aug 2009 16:02:05 +0300	[thread overview]
Message-ID: <1250686963-8357-10-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1250686963-8357-1-git-send-email-avi@redhat.com>

From: Marcelo Tosatti <mtosatti@redhat.com>

Required for EPT misconfiguration handler.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/include/asm/vmx.h |    7 +++++++
 arch/x86/kvm/vmx.c         |   20 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index e7927a6..272514c 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -352,9 +352,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
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6ee9292..6610181 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -270,6 +270,26 @@ static inline bool cpu_has_vmx_flexpriority(void)
 		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);
-- 
1.6.3.3


  parent reply	other threads:[~2009-08-19 13:03 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19 13:01 [PATCH 00/47] KVM updates for 2.6.32 merge window (2/4) Avi Kivity
2009-08-19 13:01 ` [PATCH 01/47] KVM: Return to userspace on emulation failure Avi Kivity
2009-08-19 13:01 ` [PATCH 02/47] KVM: MMU: introduce is_last_spte helper Avi Kivity
2009-08-19 13:01 ` [PATCH 03/47] KVM: MMU audit: update count_writable_mappings / count_rmaps Avi Kivity
2009-08-19 13:02 ` [PATCH 04/47] KVM: MMU audit: update audit_write_protection Avi Kivity
2009-08-19 13:02 ` [PATCH 05/47] KVM: MMU audit: nontrapping ptes in nonleaf level Avi Kivity
2009-08-19 13:02 ` [PATCH 06/47] KVM: MMU audit: audit_mappings tweaks Avi Kivity
2009-08-19 13:02 ` [PATCH 07/47] KVM: MMU audit: largepage handling Avi Kivity
2009-08-19 13:02 ` [PATCH 08/47] KVM: Move performance counter MSR access interception to generic x86 path Avi Kivity
2009-08-19 13:02 ` Avi Kivity [this message]
2009-08-19 13:02 ` [PATCH 10/47] KVM: MMU: make for_each_shadow_entry aware of largepages Avi Kivity
2009-08-19 13:02 ` [PATCH 11/47] KVM: MMU: add kvm_mmu_get_spte_hierarchy helper Avi Kivity
2009-08-19 13:02 ` [PATCH 12/47] KVM: VMX: EPT misconfiguration handler Avi Kivity
2009-08-19 13:02 ` [PATCH 13/47] KVM: VMX: conditionally disable 2M pages Avi Kivity
2009-08-19 13:02 ` [PATCH 14/47] KVM: Replace pending exception by PF if it happens serially Avi Kivity
2009-08-19 13:02 ` [PATCH 15/47] KVM: Optimize searching for highest IRR Avi Kivity
2009-08-19 13:02 ` [PATCH 16/47] KVM: Fix racy event propagation in timer Avi Kivity
2009-08-19 13:02 ` [PATCH 17/47] KVM: Drop useless atomic test from timer function Avi Kivity
2009-08-19 13:02 ` [PATCH 18/47] KVM: VMX: Only reload guest cr2 if different from host cr2 Avi Kivity
2009-08-19 13:02 ` [PATCH 19/47] KVM: SVM: Don't save/restore " Avi Kivity
2009-08-19 13:02 ` [PATCH 20/47] x86: Add definition for IGNNE MSR Avi Kivity
2009-08-19 13:02 ` [PATCH 21/47] KVM: Implement MSRs used by Hyper-V Avi Kivity
2009-08-19 13:02 ` [PATCH 22/47] KVM: SVM: Implement INVLPGA Avi Kivity
2009-08-19 13:02 ` [PATCH 23/47] KVM: SVM: Improve nested interrupt injection Avi Kivity
2009-08-19 13:02 ` [PATCH 24/47] KVM: convert custom marker based tracing to event traces Avi Kivity
2009-08-19 13:02 ` [PATCH 25/47] KVM: Allow emulation of syscalls instructions on #UD Avi Kivity
2009-08-19 13:02 ` [PATCH 26/47] KVM: x86 emulator: Add missing EFLAGS bit definitions Avi Kivity
2009-08-19 13:02 ` [PATCH 27/47] KVM: x86 emulator: Prepare for emulation of syscall instructions Avi Kivity
2009-08-19 13:02 ` [PATCH 28/47] KVM: x86 emulator: add syscall emulation Avi Kivity
2009-08-19 13:02 ` [PATCH 29/47] KVM: x86 emulator: Add sysenter emulation Avi Kivity
2009-08-19 13:02 ` [PATCH 30/47] KVM: x86 emulator: Add sysexit emulation Avi Kivity
2009-08-19 13:02 ` [PATCH 31/47] KVM: s390: Fix memslot initialization for userspace_addr != 0 Avi Kivity
2009-08-19 13:02 ` [PATCH 32/47] hugetlbfs: export vma_kernel_pagsize to modules Avi Kivity
2009-08-19 13:02 ` [PATCH 33/47] KVM: Prepare memslot data structures for multiple hugepage sizes Avi Kivity
2009-08-19 13:02 ` [PATCH 34/47] KVM: x86: missing locking in PIT/IRQCHIP/SET_BSP_CPU ioctl paths Avi Kivity
2009-08-19 13:02 ` [PATCH 35/47] KVM: ignore AMDs HWCR register access to set the FFDIS bit Avi Kivity
2009-08-19 13:02 ` [PATCH 36/47] KVM: ignore reads from AMDs C1E enabled MSR Avi Kivity
2009-08-19 13:02 ` [PATCH 37/47] KVM: introduce module parameter for ignoring unknown MSRs accesses Avi Kivity
2009-08-19 13:02 ` [PATCH 38/47] KVM: powerpc: convert marker probes to event trace Avi Kivity
2009-08-19 13:02 ` [PATCH 39/47] KVM: remove old KVMTRACE support code Avi Kivity
2009-08-19 13:02 ` [PATCH 40/47] KVM: use vcpu_id instead of bsp_vcpu pointer in kvm_vcpu_is_bsp Avi Kivity
2009-08-19 13:02 ` [PATCH 41/47] KVM: document locking for kvm_io_device_ops Avi Kivity
2009-08-19 13:02 ` [PATCH 42/47] KVM: switch coalesced mmio changes to slots_lock Avi Kivity
2009-08-19 13:02 ` [PATCH 43/47] KVM: switch pit creation " Avi Kivity
2009-08-19 13:02 ` [PATCH 44/47] KVM: convert bus " Avi Kivity
2009-08-19 13:02 ` [PATCH 45/47] KVM: remove in_range from io devices Avi Kivity
2009-08-19 13:02 ` [PATCH 46/47] KVM: document lock nesting rule Avi Kivity
2009-08-19 13:02 ` [PATCH 47/47] KVM: fix lock imbalance Avi Kivity

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=1250686963-8357-10-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.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