Skip to content

Commit 35b80f7

Browse files
sean-jcbonzini
authored andcommitted
KVM: LoongArch: Mark "struct page" pfn accessed before dropping mmu_lock
Mark pages accessed before dropping mmu_lock when faulting in guest memory so that LoongArch can convert to kvm_release_faultin_page() without tripping its lockdep assertion on mmu_lock being held. Reviewed-by: Bibo Mao <[email protected]> Signed-off-by: Sean Christopherson <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Message-ID: <[email protected]>
1 parent 4a2bc01 commit 35b80f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/kvm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,13 +902,13 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write)
902902

903903
if (writeable)
904904
kvm_set_pfn_dirty(pfn);
905+
kvm_release_pfn_clean(pfn);
905906

906907
spin_unlock(&kvm->mmu_lock);
907908

908909
if (prot_bits & _PAGE_DIRTY)
909910
mark_page_dirty_in_slot(kvm, memslot, gfn);
910911

911-
kvm_release_pfn_clean(pfn);
912912
out:
913913
srcu_read_unlock(&kvm->srcu, srcu_idx);
914914
return err;

0 commit comments

Comments
 (0)