diff mbox series

[PULL,19/20] s390x/pv: Retry ioctls on -EINTR

Message ID 20200430094445.25943-20-cohuck@redhat.com
State New
Headers show
Series [PULL,01/20] virtio-net: fix rsc_ext compat handling | expand

Commit Message

Cornelia Huck April 30, 2020, 9:44 a.m. UTC
From: Christian Borntraeger <borntraeger@de.ibm.com>

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: c3347ed0d2ee ("s390x: protvirt: Support unpack facility")
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Acked-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20200327124616.34866-1-borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/pv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c
index a40a8448060c..cb0dce4a4f06 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 "