Patch "KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-ppc-e500-mark-struct-page-pfn-accessed-before-dr.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2816dd4eaca5820f3b1b03238cfb205b0778c159
Author: Sean Christopherson <seanjc@xxxxxxxxxx>
Date:   Thu Oct 10 11:23:55 2024 -0700

    KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock
    
    [ Upstream commit 84cf78dcd9d65c45ab73998d4ad50f433d53fb93 ]
    
    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@xxxxxxxxxx>
    Tested-by: Dmitry Osipenko <dmitry.osipenko@xxxxxxxxxxxxx>
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Message-ID: <20241010182427.1434605-54-seanjc@xxxxxxxxxx>
    Stable-dep-of: 87ecfdbc699c ("KVM: e500: always restore irqs")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index b40d31cd44f7f..80f0b30abc74c 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;
 }
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux