Message ID | 20220303193842.370645-2-pbonzini@redhat.com |
---|---|
State | Accepted |
Commit | 3354ef5a592d219364cf442c2f784ce7ad7629fd |
Headers | show |
Series | [v4,01/30] KVM: x86/mmu: Check for present SPTE when clearing dirty bit in TDP MMU | expand |
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index debf08212f12..4cf0cc04b2a0 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -1468,6 +1468,9 @@ static bool clear_dirty_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, if (tdp_mmu_iter_cond_resched(kvm, &iter, false, true)) continue; + if (!is_shadow_present_pte(iter.old_spte)) + continue; + if (spte_ad_need_write_protect(iter.old_spte)) { if (is_writable_pte(iter.old_spte)) new_spte = iter.old_spte & ~PT_WRITABLE_MASK;