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.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index b432a71a1839..d15f908649e7 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1809,7 +1809,7 @@ static void validate_direct_spte(struct kvm_vcpu *vcpu, u64 *sptep,
1809 } 1809 }
1810} 1810}
1811 1811
1812static void mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp, 1812static bool mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,
1813 u64 *spte) 1813 u64 *spte)
1814{ 1814{
1815 u64 pte; 1815 u64 pte;
@@ -1817,17 +1817,21 @@ static void mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,
1817 1817
1818 pte = *spte; 1818 pte = *spte;
1819 if (is_shadow_present_pte(pte)) { 1819 if (is_shadow_present_pte(pte)) {
1820 if (is_last_spte(pte, sp->role.level)) 1820 if (is_last_spte(pte, sp->role.level)) {
1821 drop_spte(kvm, spte); 1821 drop_spte(kvm, spte);
1822 else { 1822 if (is_large_pte(pte))
1823 --kvm->stat.lpages;
1824 } else {
1823 child = page_header(pte & PT64_BASE_ADDR_MASK); 1825 child = page_header(pte & PT64_BASE_ADDR_MASK);
1824 drop_parent_pte(child, spte); 1826 drop_parent_pte(child, spte);
1825 } 1827 }
1826 } else if (is_mmio_spte(pte)) 1828 return true;
1829 }
1830
1831 if (is_mmio_spte(pte))
1827 mmu_spte_clear_no_track(spte); 1832 mmu_spte_clear_no_track(spte);
1828 1833
1829 if (is_large_pte(pte)) 1834 return false;
1830 --kvm->stat.lpages;
1831} 1835}
1832 1836
1833static void kvm_mmu_page_unlink_children(struct kvm *kvm, 1837static void kvm_mmu_page_unlink_children(struct kvm *kvm,