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, 2 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index aa98fca03ed7..ff333572be75 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1216,6 +1216,7 @@ static void kvm_mmu_commit_zap_page(struct kvm *kvm,
1216 if ((sp)->gfn != (gfn) || (sp)->role.direct || \ 1216 if ((sp)->gfn != (gfn) || (sp)->role.direct || \
1217 (sp)->role.invalid) {} else 1217 (sp)->role.invalid) {} else
1218 1218
1219/* @sp->gfn should be write-protected at the call site */
1219static int __kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp, 1220static int __kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
1220 struct list_head *invalid_list, bool clear_unsync) 1221 struct list_head *invalid_list, bool clear_unsync)
1221{ 1222{
@@ -1224,11 +1225,8 @@ static int __kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
1224 return 1; 1225 return 1;
1225 } 1226 }
1226 1227
1227 if (clear_unsync) { 1228 if (clear_unsync)
1228 if (rmap_write_protect(vcpu->kvm, sp->gfn))
1229 kvm_flush_remote_tlbs(vcpu->kvm);
1230 kvm_unlink_unsync_page(vcpu->kvm, sp); 1229 kvm_unlink_unsync_page(vcpu->kvm, sp);
1231 }
1232 1230
1233 if (vcpu->arch.mmu.sync_page(vcpu, sp)) { 1231 if (vcpu->arch.mmu.sync_page(vcpu, sp)) {
1234 kvm_mmu_prepare_zap_page(vcpu->kvm, sp, invalid_list); 1232 kvm_mmu_prepare_zap_page(vcpu->kvm, sp, invalid_list);