aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ed1074e98b8e..df8d2f127508 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9721,18 +9721,15 @@ static unsigned long nested_ept_get_cr3(struct kvm_vcpu *vcpu)
9721 9721
9722static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu) 9722static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu)
9723{ 9723{
9724 bool wants_ad;
9725
9726 WARN_ON(mmu_is_nested(vcpu)); 9724 WARN_ON(mmu_is_nested(vcpu));
9727 wants_ad = nested_ept_ad_enabled(vcpu); 9725 if (!valid_ept_address(vcpu, nested_ept_get_cr3(vcpu)))
9728 if (wants_ad && !enable_ept_ad_bits)
9729 return 1; 9726 return 1;
9730 9727
9731 kvm_mmu_unload(vcpu); 9728 kvm_mmu_unload(vcpu);
9732 kvm_init_shadow_ept_mmu(vcpu, 9729 kvm_init_shadow_ept_mmu(vcpu,
9733 to_vmx(vcpu)->nested.nested_vmx_ept_caps & 9730 to_vmx(vcpu)->nested.nested_vmx_ept_caps &
9734 VMX_EPT_EXECUTE_ONLY_BIT, 9731 VMX_EPT_EXECUTE_ONLY_BIT,
9735 wants_ad); 9732 nested_ept_ad_enabled(vcpu));
9736 vcpu->arch.mmu.set_cr3 = vmx_set_cr3; 9733 vcpu->arch.mmu.set_cr3 = vmx_set_cr3;
9737 vcpu->arch.mmu.get_cr3 = nested_ept_get_cr3; 9734 vcpu->arch.mmu.get_cr3 = nested_ept_get_cr3;
9738 vcpu->arch.mmu.inject_page_fault = nested_ept_inject_page_fault; 9735 vcpu->arch.mmu.inject_page_fault = nested_ept_inject_page_fault;