From b80084bc3989d2f41d83de2b37b311c915cef236 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Wed, 2 Jun 2010 14:05:24 +0800 Subject: [PATCH] --- yaml --- r: 202313 b: refs/heads/master c: 4bc9b9828150747386130ab172f7e868e1a0fc2a h: refs/heads/master i: 202311: 447ec33d0e852841a1531385af2f5d21e2e21ece v: v3 --- [refs] | 2 +- trunk/arch/x86/kvm/vmx.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 750931586660..33e3814d6047 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d2d7a61127ced8ce9ec7666991aad1d846932212 +refs/heads/master: 4bc9b9828150747386130ab172f7e868e1a0fc2a diff --git a/trunk/arch/x86/kvm/vmx.c b/trunk/arch/x86/kvm/vmx.c index 8c9085d44c37..2201e3816205 100644 --- a/trunk/arch/x86/kvm/vmx.c +++ b/trunk/arch/x86/kvm/vmx.c @@ -340,6 +340,11 @@ static inline bool cpu_has_vmx_ept_1g_page(void) return vmx_capability.ept & VMX_EPT_1GB_PAGE_BIT; } +static inline bool cpu_has_vmx_ept_4levels(void) +{ + return vmx_capability.ept & VMX_EPT_PAGE_WALK_4_BIT; +} + static inline bool cpu_has_vmx_invept_individual_addr(void) { return vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT; @@ -1568,7 +1573,8 @@ static __init int hardware_setup(void) if (!cpu_has_vmx_vpid()) enable_vpid = 0; - if (!cpu_has_vmx_ept()) { + if (!cpu_has_vmx_ept() || + !cpu_has_vmx_ept_4levels()) { enable_ept = 0; enable_unrestricted_guest = 0; }