yeahuh / rpms / qemu-kvm

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