aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 5c28e979d730..c8acb9609ca4 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2714,6 +2714,7 @@ static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu)
2714 context->shadow_root_level = kvm_x86_ops->get_tdp_level(); 2714 context->shadow_root_level = kvm_x86_ops->get_tdp_level();
2715 context->root_hpa = INVALID_PAGE; 2715 context->root_hpa = INVALID_PAGE;
2716 context->direct_map = true; 2716 context->direct_map = true;
2717 context->set_cr3 = kvm_x86_ops->set_cr3;
2717 2718
2718 if (!is_paging(vcpu)) { 2719 if (!is_paging(vcpu)) {
2719 context->gva_to_gpa = nonpaging_gva_to_gpa; 2720 context->gva_to_gpa = nonpaging_gva_to_gpa;
@@ -2752,7 +2753,8 @@ static int init_kvm_softmmu(struct kvm_vcpu *vcpu)
2752 r = paging32_init_context(vcpu); 2753 r = paging32_init_context(vcpu);
2753 2754
2754 vcpu->arch.mmu.base_role.cr4_pae = !!is_pae(vcpu); 2755 vcpu->arch.mmu.base_role.cr4_pae = !!is_pae(vcpu);
2755 vcpu->arch.mmu.base_role.cr0_wp = is_write_protection(vcpu); 2756 vcpu->arch.mmu.base_role.cr0_wp = is_write_protection(vcpu);
2757 vcpu->arch.mmu.set_cr3 = kvm_x86_ops->set_cr3;
2756 2758
2757 return r; 2759 return r;
2758} 2760}
@@ -2796,7 +2798,7 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu)
2796 if (r) 2798 if (r)
2797 goto out; 2799 goto out;
2798 /* set_cr3() should ensure TLB has been flushed */ 2800 /* set_cr3() should ensure TLB has been flushed */
2799 kvm_x86_ops->set_cr3(vcpu, vcpu->arch.mmu.root_hpa); 2801 vcpu->arch.mmu.set_cr3(vcpu, vcpu->arch.mmu.root_hpa);
2800out: 2802out:
2801 return r; 2803 return r;
2802} 2804}