From: Wanpeng Li Date: Thu, 11 May 2017 09:58:56 +0000 (-0700) Subject: KVM: VMX: Don't enable EPT A/D feature if EPT feature is disabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fce6ac4c0508b985d497e3d9c8eff28ec8a43182;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git KVM: VMX: Don't enable EPT A/D feature if EPT feature is disabled We can observe eptad kvm_intel module parameter is still Y even if ept is disabled which is weird. This patch will not enable EPT A/D feature if EPT feature is disabled. Cc: Paolo Bonzini Cc: Radim Krčmář Signed-off-by: Wanpeng Li Signed-off-by: Radim Krčmář --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 7698e8f321bf..72f78396bc09 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6504,7 +6504,7 @@ static __init int hardware_setup(void) enable_ept_ad_bits = 0; } - if (!cpu_has_vmx_ept_ad_bits()) + if (!cpu_has_vmx_ept_ad_bits() || !enable_ept) enable_ept_ad_bits = 0; if (!cpu_has_vmx_unrestricted_guest())