summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2024-10-10 20:23:55 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-25 19:00:48 +0200
commit84cf78dcd9d65c45ab73998d4ad50f433d53fb93 (patch)
treed97a56ab6cf69b6c34ad7af3d4416b00e70ea7c5 /arch
parentKVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map() (diff)
downloadlinux-84cf78dcd9d65c45ab73998d4ad50f433d53fb93.tar.xz
linux-84cf78dcd9d65c45ab73998d4ad50f433d53fb93.zip
KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock
Mark pages accessed before dropping mmu_lock when faulting in guest memory so that shadow_map() can convert to kvm_release_faultin_page() without tripping its lockdep assertion on mmu_lock being held. Marking pages accessed outside of mmu_lock is ok (not great, but safe), but marking pages _dirty_ outside of mmu_lock can make filesystems unhappy. 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-54-seanjc@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 5c2adfd19e12..334dd96f8081 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -498,11 +498,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
kvmppc_mmu_flush_icache(pfn);
out:
- spin_unlock(&kvm->mmu_lock);
-
/* Drop refcount on page, so that mmu notifiers can clear it */
kvm_release_pfn_clean(pfn);
-
+ spin_unlock(&kvm->mmu_lock);
return ret;
}