[Top][All Lists]

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

[PATCH v2] s390x/pv: Retry ioctls on -EINTR

From: Christian Borntraeger
Subject: [PATCH v2] s390x/pv: Retry ioctls on -EINTR
Date: Fri, 27 Mar 2020 08:46:16 -0400

PV_ENABLE (and maybe others) might return -EINTR when a signal is
pending. See the Linux kernel patch "s390/gmap: return proper error code
on ksm unsharing" for details. Let us retry the ioctl in that case.

Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility")
Reported-by: Marc Hartmayer <address@hidden>
Acked-by: Janosch Frank <address@hidden>
Tested-by: Marc Hartmayer <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
 hw/s390x/pv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c
index 8cf5cd2c9b..d3333d6e13 100644
--- a/hw/s390x/pv.c
+++ b/hw/s390x/pv.c
@@ -23,7 +23,11 @@ static int __s390_pv_cmd(uint32_t cmd, const char *cmdname, 
void *data)
         .cmd = cmd,
         .data = (uint64_t)data,
-    int rc = kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd);
+    int rc;
+    do {
+        rc = kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd);
+    } while (rc == -EINTR);
     if (rc) {
         error_report("KVM PV command %d (%s) failed: header rc %x rrc %x "

reply via email to

[Prev in Thread] Current Thread [Next in Thread]