From: Farhan Ali <alifm@linux.ibm.com>
To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: mjrosato@linux.ibm.com, alifm@linux.ibm.com, thuth@redhat.com,
	alex.williamson@redhat.com, clg@redhat.com
Subject: [PATCH v3 0/5] Error recovery for zPCI passthrough devices
Date: Thu, 25 Sep 2025 10:48:47 -0700	[thread overview]
Message-ID: <20250925174852.1302-1-alifm@linux.ibm.com> (raw)
Hi,
This patch series introduces support for error recovery for passthrough
PCI devices on System Z (s390x). This is the user space component for the Linux
kernel patches [1]. For QEMU on eventfd notification for PCI error from vfio-pci
driver we call the vfio error handler. We can use a per device error
handler callback to override the default vfio error handler. 
For s390x specific error handler, we retrieve the architecture specific PCI error
information and inject the information into the guest. Once the guest receives
the error information, the guest drivers will drive the error recovery.
Typically recovery involves a device reset which translate to CLP
disable/enable cycle for the device.
I would appreciate some feedback on this patch series.
Thanks
Farhan
[1] https://lore.kernel.org/all/20250924171628.826-1-alifm@linux.ibm.com/
ChangeLog
---------
v2 https://lore.kernel.org/qemu-devel/20250825212434.2255-1-alifm@linux.ibm.com/
v2 -> v3
    - Update arch_err_handler to err_handler and include Error ** in
    function definition. (patch 2)
    - Introduce helper function to hide the internal indirection of device_feature()
    (patch 3)
    - Update function definitions to include Error ** (patch 4)
    
v1 https://lore.kernel.org/qemu-devel/20250813174152.1238-1-alifm@linux.ibm.com/
v1 -> v2
   - Use VFIO_DEVICE_FEATURE ioctl to get device error information.
   (Based on Alex's feedback on kernel series)
Farhan Ali (5):
  [NOTFORMERGE] linux-headers: Update for zpci vfio device
  vfio/pci: Add an error handler callback
  vfio: Introduce vfio_device_feature helper function
  s390x/pci: Add PCI error handling for vfio pci devices
  s390x/pci: Reset a device in error state
 hw/s390x/s390-pci-bus.c          | 16 ++++++
 hw/s390x/s390-pci-vfio.c         | 87 ++++++++++++++++++++++++++++++++
 hw/vfio/device.c                 |  6 +++
 hw/vfio/pci.c                    |  8 +++
 hw/vfio/pci.h                    |  1 +
 include/hw/s390x/s390-pci-bus.h  |  1 +
 include/hw/s390x/s390-pci-vfio.h |  8 +++
 include/hw/vfio/vfio-device.h    |  2 +
 linux-headers/linux/vfio.h       | 15 ++++++
 9 files changed, 144 insertions(+)
-- 
2.43.0
next             reply	other threads:[~2025-09-25 17:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 17:48 Farhan Ali [this message]
2025-09-25 17:48 ` [PATCH v3 1/5] [NOTFORMERGE] linux-headers: Update for zpci vfio device Farhan Ali
2025-09-25 17:48 ` [PATCH v3 2/5] vfio/pci: Add an error handler callback Farhan Ali
2025-09-26  4:57   ` Markus Armbruster
2025-09-26  7:40     ` Cédric Le Goater
2025-09-26 18:44       ` Farhan Ali
2025-09-26 17:53     ` Farhan Ali
2025-09-27  5:59       ` Markus Armbruster
2025-09-27  7:05         ` Cédric Le Goater
2025-09-29 17:20           ` Farhan Ali
2025-09-30  9:20             ` Markus Armbruster
2025-09-30 17:15               ` Farhan Ali
2025-10-01  4:52                 ` Markus Armbruster
2025-10-01 18:21                   ` Farhan Ali
2025-10-06  6:06                     ` Markus Armbruster
2025-09-25 17:48 ` [PATCH v3 3/5] vfio: Introduce vfio_device_feature helper function Farhan Ali
2025-09-25 17:48 ` [PATCH v3 4/5] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
2025-09-25 17:48 ` [PATCH v3 5/5] s390x/pci: Reset a device in error state Farhan Ali
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=20250925174852.1302-1-alifm@linux.ibm.com \
    --to=alifm@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=clg@redhat.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /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).