aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/paging_tmpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r--arch/x86/kvm/paging_tmpl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 0f11792fafa..6bd70206c56 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -446,6 +446,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
446 gpa_t pte_gpa = -1; 446 gpa_t pte_gpa = -1;
447 int level; 447 int level;
448 u64 *sptep; 448 u64 *sptep;
449 int need_flush = 0;
449 450
450 spin_lock(&vcpu->kvm->mmu_lock); 451 spin_lock(&vcpu->kvm->mmu_lock);
451 452
@@ -465,6 +466,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
465 rmap_remove(vcpu->kvm, sptep); 466 rmap_remove(vcpu->kvm, sptep);
466 if (is_large_pte(*sptep)) 467 if (is_large_pte(*sptep))
467 --vcpu->kvm->stat.lpages; 468 --vcpu->kvm->stat.lpages;
469 need_flush = 1;
468 } 470 }
469 set_shadow_pte(sptep, shadow_trap_nonpresent_pte); 471 set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
470 break; 472 break;
@@ -474,6 +476,8 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
474 break; 476 break;
475 } 477 }
476 478
479 if (need_flush)
480 kvm_flush_remote_tlbs(vcpu->kvm);
477 spin_unlock(&vcpu->kvm->mmu_lock); 481 spin_unlock(&vcpu->kvm->mmu_lock);
478 482
479 if (pte_gpa == -1) 483 if (pte_gpa == -1)