KVM: MIPS: Mark "struct page" pfns accessed prior to dropping mmu_lock

Mark pages accessed before dropping mmu_lock when faulting in guest memory
so that MIPS can convert to kvm_release_faultin_page() without tripping
its lockdep assertion on mmu_lock being held.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010182427.1434605-72-seanjc@google.com>
This commit is contained in:
Sean Christopherson 2024-10-10 11:24:13 -07:00 committed by Paolo Bonzini
parent 4d75f14fc8
commit 13d66fddaa

View File

@ -634,10 +634,9 @@ retry:
if (writeable)
kvm_set_pfn_dirty(pfn);
kvm_release_pfn_clean(pfn);
spin_unlock(&kvm->mmu_lock);
kvm_release_pfn_clean(pfn);
kvm_set_pfn_accessed(pfn);
out:
srcu_read_unlock(&kvm->srcu, srcu_idx);
return err;