aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/vmx.c5
-rw-r--r--arch/x86/kvm/x86.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index bf46253149c3..a5f3f3ec69e6 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1737,6 +1737,7 @@ static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
1737 vmcs_write64(EPT_POINTER, eptp); 1737 vmcs_write64(EPT_POINTER, eptp);
1738 guest_cr3 = is_paging(vcpu) ? vcpu->arch.cr3 : 1738 guest_cr3 = is_paging(vcpu) ? vcpu->arch.cr3 :
1739 vcpu->kvm->arch.ept_identity_map_addr; 1739 vcpu->kvm->arch.ept_identity_map_addr;
1740 ept_load_pdptrs(vcpu);
1740 } 1741 }
1741 1742
1742 vmx_flush_tlb(vcpu); 1743 vmx_flush_tlb(vcpu);
@@ -3625,10 +3626,6 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
3625{ 3626{
3626 struct vcpu_vmx *vmx = to_vmx(vcpu); 3627 struct vcpu_vmx *vmx = to_vmx(vcpu);
3627 3628
3628 if (enable_ept && is_paging(vcpu)) {
3629 vmcs_writel(GUEST_CR3, vcpu->arch.cr3);
3630 ept_load_pdptrs(vcpu);
3631 }
3632 /* Record the guest's net vcpu time for enforced NMI injections. */ 3629 /* Record the guest's net vcpu time for enforced NMI injections. */
3633 if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked)) 3630 if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
3634 vmx->entry_time = ktime_get(); 3631 vmx->entry_time = ktime_get();
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index dbddcc2d2c97..719f31eecd3d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4591,8 +4591,10 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
4591 4591
4592 mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4; 4592 mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4;
4593 kvm_x86_ops->set_cr4(vcpu, sregs->cr4); 4593 kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
4594 if (!is_long_mode(vcpu) && is_pae(vcpu)) 4594 if (!is_long_mode(vcpu) && is_pae(vcpu)) {
4595 load_pdptrs(vcpu, vcpu->arch.cr3); 4595 load_pdptrs(vcpu, vcpu->arch.cr3);
4596 mmu_reset_needed = 1;
4597 }
4596 4598
4597 if (mmu_reset_needed) 4599 if (mmu_reset_needed)
4598 kvm_mmu_reset_context(vcpu); 4600 kvm_mmu_reset_context(vcpu);