summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-06-11 12:07:44 -0300
committerAvi Kivity <avi@redhat.com>2009-09-10 08:32:56 +0300
commit54dee9933e8d93589ad63ec3d6be39f1921b0767 (patch)
tree77aa79604ddfb6f842e582e7b8ce7cdbc54b2060 /arch
parent68f89400bc92421d6da22e1ec8e3ec599c3c8244 (diff)
downloadop-kernel-dev-54dee9933e8d93589ad63ec3d6be39f1921b0767.zip
op-kernel-dev-54dee9933e8d93589ad63ec3d6be39f1921b0767.tar.gz
KVM: VMX: conditionally disable 2M pages
Disable usage of 2M pages if VMX_EPT_2MB_PAGE_BIT (bit 16) is clear in MSR_IA32_VMX_EPT_VPID_CAP and EPT is enabled. [avi: s/largepages_disabled/largepages_enabled/ to avoid negative logic] Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 94c07ad..fc8d49c 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1381,6 +1381,9 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_tpr_shadow())
kvm_x86_ops->update_cr8_intercept = NULL;
+ if (enable_ept && !cpu_has_vmx_ept_2m_page())
+ kvm_disable_largepages();
+
return alloc_kvm_area();
}
OpenPOWER on IntegriCloud