thebeanogamer / rpms / qemu-kvm

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