From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Cédric Le Goater" <clg@redhat.com>,
"Eric Farman" <farman@linux.ibm.com>
Subject: [PULL 02/11] s390x/pci: refresh fh before disabling aif
Date: Fri, 19 Jan 2024 16:24:58 +0100 [thread overview]
Message-ID: <20240119152507.55182-3-thuth@redhat.com> (raw)
In-Reply-To: <20240119152507.55182-1-thuth@redhat.com>
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>
---
hw/s390x/s390-pci-kvm.c | 9 +++++++++
1 file changed, 9 insertions(+)
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.43.0
next prev parent reply other threads:[~2024-01-19 15:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-19 15:24 [PULL 00/11] s390x fixes, removal of deprecated options, netbsd VM fix Thomas Huth
2024-01-19 15:24 ` [PULL 01/11] s390x/pci: avoid double enable/disable of aif Thomas Huth
2024-01-19 15:24 ` Thomas Huth [this message]
2024-01-19 15:24 ` [PULL 03/11] s390x/pci: drive ISM reset from subsystem reset Thomas Huth
2024-01-19 15:25 ` [PULL 04/11] qemu-options: Remove the deprecated -no-hpet option Thomas Huth
2024-01-19 15:25 ` [PULL 05/11] qemu-options: Remove the deprecated -no-acpi option Thomas Huth
2024-01-19 15:25 ` [PULL 06/11] qemu-options: Remove the deprecated -async-teardown option Thomas Huth
2024-01-19 15:25 ` [PULL 07/11] qemu-options: Remove the deprecated -chroot option Thomas Huth
2024-01-19 15:25 ` [PULL 08/11] qapi: Remove deprecated 'singlestep' member of StatusInfo Thomas Huth
2024-01-19 15:25 ` [PULL 09/11] hmp: Remove deprecated 'singlestep' command Thomas Huth
2024-01-19 15:25 ` [PULL 10/11] cli: Remove deprecated '-singlestep' command line option Thomas Huth
2024-01-19 15:25 ` [PULL 11/11] tests/vm/netbsd: Remove missing py311-expat package Thomas Huth
2024-01-22 8:48 ` [PULL 00/11] s390x fixes, removal of deprecated options, netbsd VM fix Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240119152507.55182-3-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=clg@redhat.com \
--cc=farman@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).