* [PATCH v7 0/2] Error recovery for zPCI passthrough devices
@ 2026-10-05 17:43 Farhan Ali
2026-10-05 17:43 ` [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Farhan Ali @ 2026-10-05 17:43 UTC (permalink / raw)
To: qemu-s390x, qemu-devel; +Cc: alifm, mjrosato, farman, cohuck, alex, clg
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
---------
v6 https://lore.kernel.org/all/20260922171756.920-1-alifm@linux.ibm.com/
v6 -> v7
- Address Matt's feedback.
- Add an explicit check for pci_aer (patch 1).
- Change return code for s390_pci_get_feature_err() to return <0 on error
and 0 (on ENOMSG) or 1 on success as suggested by Matt.
- Use common code function pci_device_reset() as it will invoke the
VFIO_RESET_DEVICE ioctl.
- Change state from ZPCI_FS_ERROR to ZPCI_FS_DISABLED on a reset from error state.
v5 https://lore.kernel.org/all/20260914174420.12309-1-alifm@linux.ibm.com/
v5 -> v6
- Address Cedric's feedback (patch 1).
- Update error handling to follow QEMU style (patch 1).
- Rebase on master.
- Remove linux-headers update as latest QEMU master has the VFIO headers
merged.
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 (2):
s390x/pci: Add PCI error handling for vfio pci devices
s390x/pci: Reset a device in error state
hw/s390x/s390-pci-bus.c | 21 ++++++
hw/s390x/s390-pci-vfio-stubs.c | 6 ++
hw/s390x/s390-pci-vfio.c | 123 +++++++++++++++++++++++++++++++
include/hw/s390x/s390-pci-bus.h | 1 +
include/hw/s390x/s390-pci-vfio.h | 1 +
5 files changed, 152 insertions(+)
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices
2026-10-05 17:43 [PATCH v7 0/2] Error recovery for zPCI passthrough devices Farhan Ali
@ 2026-10-05 17:43 ` Farhan Ali
2026-10-05 21:44 ` Matthew Rosato
2026-10-05 17:43 ` [PATCH v7 2/2] s390x/pci: Reset a device in error state Farhan Ali
2026-10-05 21:44 ` [PATCH v7 0/2] Error recovery for zPCI passthrough devices Matthew Rosato
2 siblings, 1 reply; 8+ messages in thread
From: Farhan Ali @ 2026-10-05 17:43 UTC (permalink / raw)
To: qemu-s390x, qemu-devel; +Cc: alifm, mjrosato, farman, cohuck, alex, clg
Add an s390x specific handler for vfio error notifier. For s390x pci devices,
we have platform specific error information. We need to retrieve this error
information for passthrough devices. This is done via a VFIO_DEVICE_FEATURE
ioctl which exposes that information.
Once this error information is retrieved we can then inject an error into
the guest, and let the guest drive the recovery.
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
---
hw/s390x/s390-pci-bus.c | 6 ++
hw/s390x/s390-pci-vfio-stubs.c | 6 ++
hw/s390x/s390-pci-vfio.c | 123 +++++++++++++++++++++++++++++++
include/hw/s390x/s390-pci-bus.h | 1 +
include/hw/s390x/s390-pci-vfio.h | 1 +
5 files changed, 137 insertions(+)
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 2eb4e8cec4..b2967dacba 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -1085,6 +1085,7 @@ static void s390_pcihost_plug(const HotplugHandler *hotplug_dev, DeviceState *de
S390pciState *s = S390_PCI_HOST_BRIDGE(hotplug_dev);
PCIDevice *pdev = NULL;
S390PCIBusDevice *pbdev = NULL;
+ Error *local_err = NULL;
int rc;
if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_BRIDGE)) {
@@ -1175,6 +1176,11 @@ static void s390_pcihost_plug(const HotplugHandler *hotplug_dev, DeviceState *de
pbdev->iommu->dma_limit = s390_pci_start_dma_count(s, pbdev);
/* Fill in CLP information passed via the vfio region */
s390_pci_get_clp_info(pbdev);
+ /* Setup error handler for error recovery */
+ if (!s390_pci_setup_err_handler(pbdev, &local_err)) {
+ warn_report_err(local_err);
+ }
+
if (!pbdev->interp) {
/* Do vfio passthrough but intercept for I/O */
pbdev->fh |= FH_SHM_VFIO;
diff --git a/hw/s390x/s390-pci-vfio-stubs.c b/hw/s390x/s390-pci-vfio-stubs.c
index d9882b7aad..9fc84ca135 100644
--- a/hw/s390x/s390-pci-vfio-stubs.c
+++ b/hw/s390x/s390-pci-vfio-stubs.c
@@ -30,3 +30,9 @@ bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh)
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
{
}
+
+bool s390_pci_setup_err_handler(S390PCIBusDevice *pbdev, Error **errp)
+{
+ error_setg(errp, "VFIO not available, cannot setup error handler");
+ return false;
+}
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
index db6de00bd2..0153faae86 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -10,6 +10,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include <sys/ioctl.h>
#include <linux/vfio.h>
@@ -105,6 +106,80 @@ void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt)
}
}
+static int s390_pci_get_feature_err(VFIOPCIDevice *vfio_pci,
+ PciCcdfErr *ccdf,
+ uint32_t ccdf_err_length,
+ Error **errp)
+{
+ ERRP_GUARD();
+ int ret;
+ size_t total_size;
+ struct vfio_device_feature_zpci_err *err;
+ g_autofree void *buf = NULL;
+ g_autofree struct vfio_device_feature *feature = NULL;
+
+ total_size = sizeof(*feature) + sizeof(*err);
+ feature = g_malloc(total_size);
+ feature->argsz = total_size;
+ feature->flags = VFIO_DEVICE_FEATURE_GET | VFIO_DEVICE_FEATURE_ZPCI_ERROR;
+
+ buf = g_malloc(ccdf_err_length);
+ err = (void *)feature->data;
+ err->data = (uint64_t)buf;
+ ret = vfio_device_get_feature(&vfio_pci->vbasedev, feature);
+
+ if (ret) {
+ if (ret == -ENOMSG) {
+ return 0;
+ }
+ error_setg(errp, "Failed feature get VFIO_DEVICE_FEATURE_ZPCI_ERROR"
+ " (rc=%d)", ret);
+ return ret;
+ }
+
+ memcpy(ccdf, buf, ccdf_err_length);
+
+ return 1;
+}
+
+static void s390_pci_err_handler(void *opaque)
+{
+ VFIOPCIDevice *vfio_pci;
+ S390PCIBusDevice *pbdev;
+ Error *local_err = NULL;
+ PciCcdfErr ccdf;
+ int ret = 0;
+
+ vfio_pci = opaque;
+ if (!event_notifier_test_and_clear(&vfio_pci->err_notifier)) {
+ return;
+ }
+
+ pbdev = s390_pci_find_dev_by_pci(s390_get_phb(), PCI_DEVICE(vfio_pci));
+
+ if (!pbdev) {
+ error_report("No matching zpci device found");
+ return;
+ }
+ pbdev->state = ZPCI_FS_ERROR;
+
+ do {
+ ret = s390_pci_get_feature_err(vfio_pci, &ccdf,
+ pbdev->ccdf_err_length, &local_err);
+ if (ret < 0) {
+ error_report_err(local_err);
+ break;
+ }
+
+ if (ret > 0) {
+ s390_pci_generate_error_event(ccdf.pec, pbdev->fh, pbdev->fid,
+ ccdf.faddr, ccdf.e);
+ }
+ } while (ret > 0);
+
+ return;
+}
+
static void s390_pci_read_base(S390PCIBusDevice *pbdev,
struct vfio_device_info *info)
{
@@ -134,6 +209,10 @@ static void s390_pci_read_base(S390PCIBusDevice *pbdev,
/* Store function type separately for type-specific behavior */
pbdev->pft = cap->pft;
+ if (hdr->version >= 3) {
+ pbdev->ccdf_err_length = cap->ccdf_err_length;
+ }
+
/*
* If the device is a passthrough ISM device, disallow relaxed
* translation.
@@ -371,3 +450,47 @@ void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
s390_pci_read_util(pbdev, info);
s390_pci_read_pfip(pbdev, info);
}
+
+bool s390_pci_setup_err_handler(S390PCIBusDevice *pbdev, Error **errp)
+{
+ int ret;
+ int32_t fd;
+ VFIOPCIDevice *vfio_pci = VFIO_PCI_DEVICE(pbdev->pdev);
+ uint64_t buf[DIV_ROUND_UP(sizeof(struct vfio_device_feature),
+ sizeof(uint64_t))] = {};
+ struct vfio_device_feature *feature = (struct vfio_device_feature *)buf;
+
+ feature->argsz = sizeof(buf);
+ feature->flags = VFIO_DEVICE_FEATURE_PROBE | VFIO_DEVICE_FEATURE_ZPCI_ERROR;
+
+ ret = vfio_device_get_feature(&vfio_pci->vbasedev, feature);
+
+ if (ret != 0) {
+ if (ret == -ENOTTY) {
+ error_setg(errp, "Automated error recovery unavailable for device");
+ } else {
+ error_setg(errp,
+ "Failed to probe for VFIO_DEVICE_FEATURE_ZPCI_ERROR (ret=%d)",
+ ret);
+ }
+ return false;
+ }
+
+ if (sizeof(PciCcdfErr) != pbdev->ccdf_err_length) {
+ error_setg(errp,
+ "CCDF size mismatch expected size=%zu, provided size=%d",
+ sizeof(PciCcdfErr), pbdev->ccdf_err_length);
+ return false;
+ }
+
+ if (!vfio_pci->pci_aer) {
+ error_setg(errp, "%s: VFIO error notifier not registered for device",
+ vfio_pci->vbasedev.name);
+ return false;
+ }
+
+ fd = event_notifier_get_fd(&vfio_pci->err_notifier);
+ qemu_set_fd_handler(fd, s390_pci_err_handler, NULL, vfio_pci);
+
+ return true;
+}
diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h
index f182bab246..63cf2b7222 100644
--- a/include/hw/s390x/s390-pci-bus.h
+++ b/include/hw/s390x/s390-pci-bus.h
@@ -365,6 +365,7 @@ struct S390PCIBusDevice {
bool forwarding_assist;
bool aif;
bool rtr_avail;
+ uint32_t ccdf_err_length;
QTAILQ_ENTRY(S390PCIBusDevice) link;
};
diff --git a/include/hw/s390x/s390-pci-vfio.h b/include/hw/s390x/s390-pci-vfio.h
index f7d6149daf..c7886b63ea 100644
--- a/include/hw/s390x/s390-pci-vfio.h
+++ b/include/hw/s390x/s390-pci-vfio.h
@@ -20,5 +20,6 @@ S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s,
void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt);
bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh);
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev);
+bool s390_pci_setup_err_handler(S390PCIBusDevice *pbdev, Error **errp);
#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v7 2/2] s390x/pci: Reset a device in error state
2026-10-05 17:43 [PATCH v7 0/2] Error recovery for zPCI passthrough devices Farhan Ali
2026-10-05 17:43 ` [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
@ 2026-10-05 17:43 ` Farhan Ali
2026-10-05 20:38 ` Matthew Rosato
2026-10-05 21:44 ` [PATCH v7 0/2] Error recovery for zPCI passthrough devices Matthew Rosato
2 siblings, 1 reply; 8+ messages in thread
From: Farhan Ali @ 2026-10-05 17:43 UTC (permalink / raw)
To: qemu-s390x, qemu-devel; +Cc: alifm, mjrosato, farman, cohuck, alex, clg
For passthrough devices in error state, for a guest driven reset of the
device we can attempt a reset to recover the device. A reset of the device
will trigger a CLP disable/enable cycle on the host to bring the device
into a recovered state.
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
---
hw/s390x/s390-pci-bus.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index b2967dacba..6557ec4240 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -1505,6 +1505,21 @@ static void s390_pci_device_reset(DeviceState *dev)
return;
case ZPCI_FS_STANDBY:
break;
+ case ZPCI_FS_ERROR:
+ /*
+ * Attempt a reset to recover the device. A device in ERROR state
+ * can be transitioned to ENABLED or DISABLED state via guest
+ * driven actions. Since this code path is also executed on
+ * subsystem_reset() and the expected state of a configured device
+ * after subsystem_reset() is to be in a DISABLED state, we need to
+ * transition from ERROR to DISABLED.
+ *
+ * Linux guests drive the state transition from ERROR to DISABLED
+ * via CLP_SET_DISABLE_PCI_FN. So it should be safe to transition
+ * from ERROR to DISABLED state.
+ */
+ pci_device_reset(pbdev->pdev);
+ /* fallthrough */
default:
pbdev->fh &= ~FH_MASK_ENABLE;
pbdev->state = ZPCI_FS_DISABLED;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v7 2/2] s390x/pci: Reset a device in error state
2026-10-05 17:43 ` [PATCH v7 2/2] s390x/pci: Reset a device in error state Farhan Ali
@ 2026-10-05 20:38 ` Matthew Rosato
0 siblings, 0 replies; 8+ messages in thread
From: Matthew Rosato @ 2026-10-05 20:38 UTC (permalink / raw)
To: Farhan Ali, qemu-s390x, qemu-devel; +Cc: farman, cohuck, alex, clg
On 10/5/26 1:43 PM, Farhan Ali wrote:
> For passthrough devices in error state, for a guest driven reset of the
> device we can attempt a reset to recover the device. A reset of the device
> will trigger a CLP disable/enable cycle on the host to bring the device
> into a recovered state.
>
> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices
2026-10-05 17:43 ` [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
@ 2026-10-05 21:44 ` Matthew Rosato
0 siblings, 0 replies; 8+ messages in thread
From: Matthew Rosato @ 2026-10-05 21:44 UTC (permalink / raw)
To: Farhan Ali, qemu-s390x, qemu-devel; +Cc: farman, cohuck, alex, clg
On 10/5/26 1:43 PM, Farhan Ali wrote:
> Add an s390x specific handler for vfio error notifier. For s390x pci devices,
> we have platform specific error information. We need to retrieve this error
> information for passthrough devices. This is done via a VFIO_DEVICE_FEATURE
> ioctl which exposes that information.
>
> Once this error information is retrieved we can then inject an error into
> the guest, and let the guest drive the recovery.
>
> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
A few comments below but I think no changes required...
[...]
> diff --git a/hw/s390x/s390-pci-vfio-stubs.c b/hw/s390x/s390-pci-vfio-stubs.c
> index d9882b7aad..9fc84ca135 100644
> --- a/hw/s390x/s390-pci-vfio-stubs.c
> +++ b/hw/s390x/s390-pci-vfio-stubs.c
> @@ -30,3 +30,9 @@ bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh)
> void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
> {
> }
> +
> +bool s390_pci_setup_err_handler(S390PCIBusDevice *pbdev, Error **errp)
> +{
> + error_setg(errp, "VFIO not available, cannot setup error handler");
> + return false;
> +}
I wondered for a bit about whether g_assert_not_reached() makes sense
here, since we never call it without first detecting a vfio-pci device,
which should be impossible without VFIO.
But this should also be fine: it satisfies error.h if we were ever to
get here, I just don't expect we will.
[...]
> @@ -134,6 +209,10 @@ static void s390_pci_read_base(S390PCIBusDevice *pbdev,
> /* Store function type separately for type-specific behavior */
> pbdev->pft = cap->pft;
>
> + if (hdr->version >= 3) {
> + pbdev->ccdf_err_length = cap->ccdf_err_length;
> + }
> +
This value won't be migrated if we also take Konstantin's migration
series. But that's OK since it's vfio-pci-only and we still won't allow
migration of s390x vfio-pci with his series.
It also looks like a value we want to re-acquire on the target system,
not migrate.
> /*
> * If the device is a passthrough ISM device, disallow relaxed
> * translation.
> @@ -371,3 +450,47 @@ void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
> s390_pci_read_util(pbdev, info);
> s390_pci_read_pfip(pbdev, info);
> }
> +
> +bool s390_pci_setup_err_handler(S390PCIBusDevice *pbdev, Error **errp)
> +{
> + int ret;
> + int32_t fd;
> + VFIOPCIDevice *vfio_pci = VFIO_PCI_DEVICE(pbdev->pdev);
> + uint64_t buf[DIV_ROUND_UP(sizeof(struct vfio_device_feature),
> + sizeof(uint64_t))] = {};
> + struct vfio_device_feature *feature = (struct vfio_device_feature *)buf;
> +
> + feature->argsz = sizeof(buf);
> + feature->flags = VFIO_DEVICE_FEATURE_PROBE | VFIO_DEVICE_FEATURE_ZPCI_ERROR;
> +
> + ret = vfio_device_get_feature(&vfio_pci->vbasedev, feature);
> +
> + if (ret != 0) {
> + if (ret == -ENOTTY) {
> + error_setg(errp, "Automated error recovery unavailable for device");
> + } else {
> + error_setg(errp,
> + "Failed to probe for VFIO_DEVICE_FEATURE_ZPCI_ERROR (ret=%d)",
> + ret);
> + }
> + return false;
> + }
> +
> + if (sizeof(PciCcdfErr) != pbdev->ccdf_err_length) {
> + error_setg(errp,
> + "CCDF size mismatch expected size=%zu, provided size=%d",
> + sizeof(PciCcdfErr), pbdev->ccdf_err_length);
> + return false;
> + }
> +
> + if (!vfio_pci->pci_aer) {
> + error_setg(errp, "%s: VFIO error notifier not registered for device",
> + vfio_pci->vbasedev.name);
> + return false;
> + }
> +
> + fd = event_notifier_get_fd(&vfio_pci->err_notifier);
> + qemu_set_fd_handler(fd, s390_pci_err_handler, NULL, vfio_pci);
> +
> + return true;
> +}
> diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h
> index f182bab246..63cf2b7222 100644
> --- a/include/hw/s390x/s390-pci-bus.h
> +++ b/include/hw/s390x/s390-pci-bus.h
> @@ -365,6 +365,7 @@ struct S390PCIBusDevice {
> bool forwarding_assist;
> bool aif;
> bool rtr_avail;
> + uint32_t ccdf_err_length;
> QTAILQ_ENTRY(S390PCIBusDevice) link;
> };
>
> diff --git a/include/hw/s390x/s390-pci-vfio.h b/include/hw/s390x/s390-pci-vfio.h
> index f7d6149daf..c7886b63ea 100644
> --- a/include/hw/s390x/s390-pci-vfio.h
> +++ b/include/hw/s390x/s390-pci-vfio.h
> @@ -20,5 +20,6 @@ S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s,
> void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt);
> bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh);
> void s390_pci_get_clp_info(S390PCIBusDevice *pbdev);
> +bool s390_pci_setup_err_handler(S390PCIBusDevice *pbdev, Error **errp);
>
> #endif
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v7 0/2] Error recovery for zPCI passthrough devices
2026-10-05 17:43 [PATCH v7 0/2] Error recovery for zPCI passthrough devices Farhan Ali
2026-10-05 17:43 ` [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
2026-10-05 17:43 ` [PATCH v7 2/2] s390x/pci: Reset a device in error state Farhan Ali
@ 2026-10-05 21:44 ` Matthew Rosato
2026-10-07 6:48 ` Cédric Le Goater
2 siblings, 1 reply; 8+ messages in thread
From: Matthew Rosato @ 2026-10-05 21:44 UTC (permalink / raw)
To: Farhan Ali, qemu-s390x, qemu-devel; +Cc: farman, cohuck, alex, clg
On 10/5/26 1:43 PM, Farhan Ali wrote:
> 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
@Eric: Series LGTM at this point, let's give Cédric and/or Alex some
time to look too.
This series should also either go after Konstantin's migration series or
at least we should take my patch from that series (s390x/pci: implement
IOMMU replay) to ensure that is in place prior to enabling this recovery
feature; basically, we want that patch with whichever feature lands first.
Thanks,
Matt
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v7 0/2] Error recovery for zPCI passthrough devices
2026-10-05 21:44 ` [PATCH v7 0/2] Error recovery for zPCI passthrough devices Matthew Rosato
@ 2026-10-07 6:48 ` Cédric Le Goater
2026-10-07 17:36 ` Eric Farman
0 siblings, 1 reply; 8+ messages in thread
From: Cédric Le Goater @ 2026-10-07 6:48 UTC (permalink / raw)
To: Matthew Rosato, Farhan Ali, qemu-s390x, qemu-devel; +Cc: farman, cohuck, alex
On 10/5/26 23:44, Matthew Rosato wrote:
> On 10/5/26 1:43 PM, Farhan Ali wrote:
>> 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
>
> @Eric: Series LGTM at this point, let's give Cédric and/or Alex some
> time to look too.
Looks OK to me. The ERRP_GUARD() is not useful anymore but it is minor.
Thanks,
C.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v7 0/2] Error recovery for zPCI passthrough devices
2026-10-07 6:48 ` Cédric Le Goater
@ 2026-10-07 17:36 ` Eric Farman
0 siblings, 0 replies; 8+ messages in thread
From: Eric Farman @ 2026-10-07 17:36 UTC (permalink / raw)
To: Cédric Le Goater, Matthew Rosato, Farhan Ali, qemu-s390x,
qemu-devel
Cc: cohuck, alex
On 10/7/26 2:48 AM, Cédric Le Goater wrote:
> On 10/5/26 23:44, Matthew Rosato wrote:
>> On 10/5/26 1:43 PM, Farhan Ali wrote:
>>> 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
>>
>> @Eric: Series LGTM at this point, let's give Cédric and/or Alex some
>> time to look too.
>
>
> Looks OK to me. The ERRP_GUARD() is not useful anymore but it is minor.
>
> Thanks,
>
> C.
>
Thanks, all! Applied to the s390x queue for 11.2
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-07 17:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 17:43 [PATCH v7 0/2] Error recovery for zPCI passthrough devices Farhan Ali
2026-10-05 17:43 ` [PATCH v7 1/2] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
2026-10-05 21:44 ` Matthew Rosato
2026-10-05 17:43 ` [PATCH v7 2/2] s390x/pci: Reset a device in error state Farhan Ali
2026-10-05 20:38 ` Matthew Rosato
2026-10-05 21:44 ` [PATCH v7 0/2] Error recovery for zPCI passthrough devices Matthew Rosato
2026-10-07 6:48 ` Cédric Le Goater
2026-10-07 17:36 ` Eric Farman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.