summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-01-05 19:02:29 +0800
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 12:35:46 -0300
commit878403b788bff1af9c7f1a61e104f0c77115af29 (patch)
treead25143de372db159aec0734e049050f2b72b128 /arch/x86/kvm/vmx.c
parent17cc393596823f4bbab81e68a9e23e7beadbcfca (diff)
downloadop-kernel-dev-878403b788bff1af9c7f1a61e104f0c77115af29.zip
op-kernel-dev-878403b788bff1af9c7f1a61e104f0c77115af29.tar.gz
KVM: VMX: Enable EPT 1GB page support
Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 0fd0892..9b197b2 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -318,6 +318,11 @@ static inline bool cpu_has_vmx_ept_2m_page(void)
return !!(vmx_capability.ept & VMX_EPT_2MB_PAGE_BIT);
}
+static inline bool cpu_has_vmx_ept_1g_page(void)
+{
+ return !!(vmx_capability.ept & VMX_EPT_1GB_PAGE_BIT);
+}
+
static inline int cpu_has_vmx_invept_individual_addr(void)
{
return !!(vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT);
@@ -4038,7 +4043,11 @@ static const struct trace_print_flags vmx_exit_reasons_str[] = {
static int vmx_get_lpage_level(void)
{
- return PT_DIRECTORY_LEVEL;
+ if (enable_ept && !cpu_has_vmx_ept_1g_page())
+ return PT_DIRECTORY_LEVEL;
+ else
+ /* For shadow and EPT supported 1GB page */
+ return PT_PDPE_LEVEL;
}
static inline u32 bit(int bitno)
OpenPOWER on IntegriCloud