[PATCH v5 0/3] Error recovery for zPCI passthrough devices

Farhan Ali posted 3 patches 1 week, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260914174420.12309-1-alifm@linux.ibm.com
Maintainers: Matthew Rosato <mjrosato@linux.ibm.com>, Farhan Ali <alifm@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
hw/s390x/s390-pci-bus.c                   |  13 ++
hw/s390x/s390-pci-vfio-stubs.c            |  10 ++
hw/s390x/s390-pci-vfio.c                  | 124 +++++++++++++
include/hw/s390x/s390-pci-bus.h           |   1 +
include/hw/s390x/s390-pci-vfio.h          |   2 +
include/standard-headers/drm/drm_fourcc.h | 209 ++++++++++++++++++++--
include/standard-headers/linux/fuse.h     |  63 ++++++-
linux-headers/asm-arm64/kvm.h             |   1 +
linux-headers/asm-riscv/kvm.h             |  13 ++
linux-headers/linux/kvm.h                 |   1 +
10 files changed, 417 insertions(+), 20 deletions(-)
[PATCH v5 0/3] Error recovery for zPCI passthrough devices
Posted by Farhan Ali 1 week, 5 days ago
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]. The kernel patches were merged for 7.3 release.

The current design for QEMU updates the callback for vfio error notifier to
an s390x specific error handler if the kernel supports the new device
feature VFIO_DEVICE_FEATURE_ZPCI_ERROR, for s390 vfio-pci devices. So now
on an eventfd notification for error notifier it will invoke the s390x
specific error handler.  The s390x error handler will 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/20260818164326.387bb27b@shazbot.org/

ChangeLog
---------
v4 https://lore.kernel.org/all/20260831183151.12626-1-alifm@linux.ibm.com/
v4 -> v5
    - Remove err_handler() callback in vfio pci core.
    - Update the vfio error notifier callback to an s390x specific callback
    for s390x devices
    - Include linux headers for 7.3-rc3.
v3 https://lore.kernel.org/qemu-devel/20250925174852.1302-1-alifm@linux.ibm.com/
v3 -> v4
    - Include linux headers for 7.3-rc1.
    - Rework VFIO API changes based on the kernel API (patch 3).
    - Address Markus's comments from v3 (patch 2).

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 (3):
  linux-headers: Update Linux header to 7.3-rc3
  s390x/pci: Add PCI error handling for vfio pci devices
  s390x/pci: Reset a device in error state

 hw/s390x/s390-pci-bus.c                   |  13 ++
 hw/s390x/s390-pci-vfio-stubs.c            |  10 ++
 hw/s390x/s390-pci-vfio.c                  | 124 +++++++++++++
 include/hw/s390x/s390-pci-bus.h           |   1 +
 include/hw/s390x/s390-pci-vfio.h          |   2 +
 include/standard-headers/drm/drm_fourcc.h | 209 ++++++++++++++++++++--
 include/standard-headers/linux/fuse.h     |  63 ++++++-
 linux-headers/asm-arm64/kvm.h             |   1 +
 linux-headers/asm-riscv/kvm.h             |  13 ++
 linux-headers/linux/kvm.h                 |   1 +
 10 files changed, 417 insertions(+), 20 deletions(-)

-- 
2.43.0