yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ddf19c
From 1678288d945906d83d7adae109b842080aebaf19 Mon Sep 17 00:00:00 2001
ddf19c
From: Thomas Huth <thuth@redhat.com>
ddf19c
Date: Fri, 29 May 2020 05:54:18 -0400
ddf19c
Subject: [PATCH 36/42] s390x/pv: Retry ioctls on -EINTR
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Thomas Huth <thuth@redhat.com>
ddf19c
Message-id: <20200529055420.16855-37-thuth@redhat.com>
ddf19c
Patchwork-id: 97055
ddf19c
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH v2 36/38] s390x/pv: Retry ioctls on -EINTR
ddf19c
Bugzilla: 1828317
ddf19c
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
ddf19c
RH-Acked-by: David Hildenbrand <david@redhat.com>
ddf19c
ddf19c
From: Christian Borntraeger <borntraeger@de.ibm.com>
ddf19c
ddf19c
PV_ENABLE (and maybe others) might return -EINTR when a signal is
ddf19c
pending. See the Linux kernel patch "s390/gmap: return proper error code
ddf19c
on ksm unsharing" for details. Let us retry the ioctl in that case.
ddf19c
ddf19c
Fixes: c3347ed0d2ee ("s390x: protvirt: Support unpack facility")
ddf19c
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
ddf19c
Acked-by: Janosch Frank <frankja@linux.vnet.ibm.com>
ddf19c
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
ddf19c
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
ddf19c
Message-Id: <20200327124616.34866-1-borntraeger@de.ibm.com>
ddf19c
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ddf19c
(cherry picked from commit e8d12a55f6d3e577455b02f15907c460578c689b)
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 hw/s390x/pv.c | 6 +++++-
ddf19c
 1 file changed, 5 insertions(+), 1 deletion(-)
ddf19c
ddf19c
diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c
ddf19c
index a40a844806..cb0dce4a4f 100644
ddf19c
--- a/hw/s390x/pv.c
ddf19c
+++ b/hw/s390x/pv.c
ddf19c
@@ -23,7 +23,11 @@ static int __s390_pv_cmd(uint32_t cmd, const char *cmdname, void *data)
ddf19c
         .cmd = cmd,
ddf19c
         .data = (uint64_t)data,
ddf19c
     };
ddf19c
-    int rc = kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd);
ddf19c
+    int rc;
ddf19c
+
ddf19c
+    do {
ddf19c
+        rc = kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd);
ddf19c
+    } while (rc == -EINTR);
ddf19c
 
ddf19c
     if (rc) {
ddf19c
         error_report("KVM PV command %d (%s) failed: header rc %x rrc %x "
ddf19c
-- 
ddf19c
2.27.0
ddf19c