Skip to content
Snippets Groups Projects
Commit c2985e38 authored by Matthew Rosato's avatar Matthew Rosato Committed by Michael Tokarev
Browse files

s390x/pci: refresh fh before disabling aif


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: 03451953 ("s390x/pci: reset ISM passthrough devices on shutdown and system reset")
Reported-by: default avatarCédric Le Goater <clg@redhat.com>
Reviewed-by: default avatarEric Farman <farman@linux.ibm.com>
Signed-off-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20240118185151.265329-3-mjrosato@linux.ibm.com>
Reviewed-by: default avatarCédric Le Goater <clg@redhat.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
(cherry picked from commit 30e35258e25c75c9d799c34fd89afcafffb37084)
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent 9d6dd12b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment