]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: s390: Return -EINTR if a signal is pending while faulting-in
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 12:40:38 +0000 (14:40 +0200)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 14:51:34 +0000 (16:51 +0200)
If a fatal signal is pending while trying to fault-in a page, return
-EINTR instead of -EAGAIN.

Also fix unpack_one() to handle -EINTR properly.

Fixes: e907ae530133 ("KVM: s390: Add helper functions for fault handling")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-12-imbrenda@linux.ibm.com>

arch/s390/kvm/faultin.c
arch/s390/kvm/pv.c

index fee80047bd94ffd044e917cfa5441b9724e4080c..3cc45f7f5b2d7bee01dd178eb2597863d04af1d6 100644 (file)
@@ -91,9 +91,9 @@ int kvm_s390_faultin_gfn(struct kvm_vcpu *vcpu, struct kvm *kvm, struct guest_fa
                /* Access outside memory, addressing exception. */
                if (is_noslot_pfn(f->pfn))
                        return PGM_ADDRESSING;
-               /* Signal pending: try again. */
-               if (f->pfn == KVM_PFN_ERR_SIGPENDING)
-                       return -EAGAIN;
+               /* Fatal signal pending: bail out. */
+               if (is_sigpending_pfn(f->pfn))
+                       return -EINTR;
                /* Check if it's read-only memory; don't try to actually handle that case. */
                if (f->pfn == KVM_PFN_ERR_RO_FAULT)
                        return -EOPNOTSUPP;
index 1beacc841ca850b45ea6b380001137db80b995dc..dc204b521052c48beb24a3cc440f03e5486463b3 100644 (file)
@@ -809,7 +809,7 @@ static int unpack_one(struct kvm *kvm, unsigned long addr, u64 tweak,
                        return -EAGAIN;
        }
 
-       if (ret && ret != -EAGAIN)
+       if (ret && ret != -EAGAIN && ret != -EINTR)
                KVM_UV_EVENT(kvm, 3, "PROTVIRT VM UNPACK: failed addr %llx with rc %x rrc %x",
                             uvcb.gaddr, *rc, *rrc);
        return ret;