]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: e500: always restore irqs
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 12 Jan 2025 09:34:44 +0000 (10:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:34 +0000 (13:49 +0100)
[ Upstream commit 87ecfdbc699cc95fac73291b52650283ddcf929d ]

If find_linux_pte fails, IRQs will not be restored.  This is unlikely
to happen in practice since it would have been reported as hanging
hosts, but it should of course be fixed anyway.

Cc: stable@vger.kernel.org
Reported-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kvm/e500_mmu_host.c

index 3907922b6a8a2ccc9e9c491f2926c5f0b4875a21..138fe5eb3801f6ba3d545e3d97ecf094f89fd9e7 100644 (file)
@@ -479,7 +479,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
                if (pte_present(pte)) {
                        wimg = (pte_val(pte) >> PTE_WIMGE_SHIFT) &
                                MAS2_WIMGE_MASK;
-                       local_irq_restore(flags);
                } else {
                        local_irq_restore(flags);
                        pr_err_ratelimited("%s: pte not present: gfn %lx,pfn %lx\n",
@@ -488,8 +487,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
                        goto out;
                }
        }
-       writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
+       local_irq_restore(flags);
 
+       writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
        kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
                                ref, gvaddr, stlbe);