[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.1 53/54] s390x/pci: refresh fh before disabling aif
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.1 53/54] s390x/pci: refresh fh before disabling aif |
Date: |
Tue, 23 Jan 2024 18:46:54 +0300 |
From: Matthew Rosato <mjrosato@linux.ibm.com>
Typically we refresh the host fh during CLP enable, however it's possible
that the device goes through multiple reset events before the guest
performs another CLP enable. Let's handle this for now by refreshing the
host handle from vfio before disabling aif.
Fixes: 03451953c7 ("s390x/pci: reset ISM passthrough devices on shutdown and
system reset")
Reported-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20240118185151.265329-3-mjrosato@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 30e35258e25c75c9d799c34fd89afcafffb37084)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c
index 1ee510436c..9eef4fc3ec 100644
--- a/hw/s390x/s390-pci-kvm.c
+++ b/hw/s390x/s390-pci-kvm.c
@@ -18,6 +18,7 @@
#include "hw/s390x/s390-pci-bus.h"
#include "hw/s390x/s390-pci-kvm.h"
#include "hw/s390x/s390-pci-inst.h"
+#include "hw/s390x/s390-pci-vfio.h"
#include "cpu_models.h"
bool s390_pci_kvm_interp_allowed(void)
@@ -64,6 +65,14 @@ int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev)
return -EINVAL;
}
+ /*
+ * The device may have already been reset but we still want to relinquish
+ * the guest ISC, so always be sure to use an up-to-date host fh.
+ */
+ if (!s390_pci_get_host_fh(pbdev, &args.fh)) {
+ return -EPERM;
+ }
+
rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
if (rc == 0) {
pbdev->aif = false;
--
2.39.2
- [Stable-8.2.1 43/54] backends/cryptodev: Do not ignore throttle/backends Errors, (continued)
- [Stable-8.2.1 43/54] backends/cryptodev: Do not ignore throttle/backends Errors, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 45/54] hw/pflash: use ldn_{be,le}_p and stn_{be,le}_p, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 44/54] hw/pflash: refactor pflash_data_write(), Michael Tokarev, 2024/01/23
- [Stable-8.2.1 51/54] hw/scsi/esp-pci: set DMA_STAT_BCMBLT when BLAST command issued, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 48/54] hw/scsi/esp-pci: use correct address register for PCI DMA transfers, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 49/54] hw/scsi/esp-pci: generate PCI interrupt from separate ESP and PCI sources, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 52/54] s390x/pci: avoid double enable/disable of aif, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 54/54] s390x/pci: drive ISM reset from subsystem reset, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 46/54] hw/pflash: implement update buffer for block writes, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 50/54] hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt, Michael Tokarev, 2024/01/23
- [Stable-8.2.1 53/54] s390x/pci: refresh fh before disabling aif,
Michael Tokarev <=