Error recovery for vfio-pci devices on s390x
Subsystems (8)
Farhan Ali
maintainerv17 cover Error recovery for vfio-pci devices on s390x
Hi,
This Linux kernel patch series introduces support for error recovery for passthrough PCI devices on System Z (s390x).
Background
----------
For PCI devices on s390x an operating system receives platform specific error events from firmware rather than through AER.Today for passthrough/userspace devices, we don't attempt any error recovery and ignore any error events for the devices. The passthrough/userspace devices are managed by the vfio-pci driver. The driver does register error handling callbacks (error_detected), and on an error trigger an eventfd to userspace. But we need a mechanism to notify userspace (QEMU/guest/userspace drivers) about the error event.
Proposal
--------
We can expose this error information (currently only the PCI Error Code) via a device feature. Userspace can then obtain the error information via VFIO_DEVICE_FEATURE ioctl and take appropriate actions such as driving a device reset.
This is how a typical flow for passthrough devices to a VM would work:
For passthrough devices to a VM, the driver bound to the device on the host is vfio-pci. vfio-pci driver does support the error_detected() callback (vfio_pci_core_aer_err_detected()), and on an PCI error s390x recovery code on the host will call the vfio-pci error_detected() callback. The vfio-pci error_detected() callback will notify userspace/QEMU via an eventfd, and return PCI_ERS_RESULT_CAN_RECOVER. At this point the s390x error recovery on the host will skip any further action(see patch 4) and let userspace drive the error recovery.
Once userspace/QEMU is notified, it then injects this error into the VM so device drivers in the VM can take recovery actions. For example for a passthrough NVMe device, the VM's OS NVMe driver will access the device. At this point the VM's NVMe driver's error_detected() will drive the recovery by returning PCI_ERS_RESULT_NEED_RESET, and the s390x error recovery in the VM's OS will try to do a reset. Resets are privileged operations and so the VM will need intervention from QEMU to perform the reset. QEMU will invoke the VFIO_DEVICE_RESET ioctl to now notify the host that the VM is requesting a reset of the device. The vfio-pci driver on the host will then perform the reset on the device to recover it.
Thanks
Farhan
ChangeLog
---------
This only includes change log from last 5 revision. Older change log is available in previous version cover letter.
v16 https://lore.kernel.org/all/[email protected]/
v16 -> v17
- Handle ENOMEM case and remove unnecessary mutex_unlock (patch 4).
- Rebase on 7.1-rc4
v15 https://lore.kernel.org/all/[email protected]/
v15 -> v16
- Implement error recovery to be handled in user space mode or host mode based on checking mediated_recovery only once (suggested by Niklas).
- Rebase on 7.1-rc3
v14 https://lore.kernel.org/all/[email protected]/
v14 -> v15
- Fix issues identified by Sashiko (patch 4).
- Address Niklas feedback (patch 4 and patch 5).
- Rebase on 7.1-rc2.
v13 series https://lore.kernel.org/all/[email protected]/
v13 -> v14
- Remove version from vfio uAPI struct. Instead reserve additional space and add a flags field. The flags will be used to indicate any usage of the reserved space (patch 5).
- Remove pending_errors from vfio uAPI struct and instead return an error to indicate no more pending error for userspace to handle (patch 5).
- Rebase on recent linux master
v12 series https://lore.kernel.org/all/[email protected]/
v12 -> v13
- Add the mediated_recovery flag as part of struct zpci_ccdf_pending and protect the struct with pending_errs_lock (patch 4).
- Move dequeing pending error logic to a helper function (patch 5).
- Update device feature number for VFIO_DEVICE_FEATURE_ZPCI_ERROR (patch 5).
- Rebase on linux-next with tag next-20260410
Farhan Ali (7):
PCI: Allow per function PCI slots to fix slot reset on s390
PCI: Avoid saving config space state if inaccessible
PCI: Fail FLR when config space is inaccessible s390/pci: Store PCI error information for passthrough devices vfio-pci/zdev: Add a device feature for error information vfio/pci: Add a reset_done callback for vfio-pci driver vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX
arch/s390/include/asm/pci.h | 32 +++++++ arch/s390/pci/pci.c | 1 + arch/s390/pci/pci_event.c | 135 +++++++++++++++++++----------- drivers/pci/hotplug/rpaphp_slot.c | 2 +- drivers/pci/pci.c | 32 ++++++- drivers/pci/slot.c | 33 ++++++-- drivers/vfio/pci/vfio_pci_core.c | 22 +++-- drivers/vfio/pci/vfio_pci_intrs.c | 3 +- drivers/vfio/pci/vfio_pci_priv.h | 9 ++ drivers/vfio/pci/vfio_pci_zdev.c | 57 ++++++++++++- include/linux/pci.h | 8 +- include/uapi/linux/vfio.h | 30 +++++++ 12 files changed, 289 insertions(+), 75 deletions(-)
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 1/7 PCI: Allow per function PCI slots to fix slot reset on s390
On s390 systems, which use a machine level hypervisor, PCI devices are always accessed through a form of PCI pass-through which fundamentally operates on a per PCI function granularity. This is also reflected in the s390 PCI hotplug driver which creates hotplug slots for individual PCI functions. Its reset_slot() function, which is a wrapper for zpci_hot_reset_device(), thus also resets individual functions.
Currently, the kernel's PCI_SLOT() macro assigns the same pci_slot object to multifunction devices. This approach worked fine on s390 systems that only exposed virtual functions as individual PCI domains to the operating system. Since commit 44510d6fa0c0 ("s390/pci: Handling multifunctions") s390 supports exposing the topology of multifunction PCI devices by grouping them in a shared PCI domain. This creates a problem when resetting a function through the hotplug driver's slot_reset() interface.
When attempting to reset a function through the hotplug driver, the shared slot assignment causes the wrong function to be reset instead of the intended one. It also leaks memory as we do create a pci_slot object for the function, but don't correctly free it in pci_slot_release().
Add a flag for struct pci_slot to allow per function PCI slots for functions managed through a hypervisor, which exposes individual PCI functions while retaining the topology. Since we can use all 8 bits for slot 'number' (for ARI devices), change slot 'number' u16 to account for special values -1 and PCI_SLOT_ALL_DEVICES.
--- drivers/pci/hotplug/rpaphp_slot.c | 2 +- drivers/pci/pci.c | 5 +++-- drivers/pci/slot.c | 33 +++++++++++++++++++++++-------- include/linux/pci.h | 8 ++++++-- 4 files changed, 35 insertions(+), 13 deletions(-)
drivers/pci/hotplug/rpaphp_slot.c +1 -1
@@ -84,7 +84,7 @@ int rpaphp_register_slot(struct slot *slot)struct hotplug_slot *php_slot = &slot->hotplug_slot;u32 my_index;int retval; -int slotno =-1 ; +int slotno =PCI_SLOT_PLACEHOLDER ; dbg("%s registering slot:path[%pOF] index[%x], name[%s] pdomain[%x] type[%d]\n", __func__, slot->dn, slot->index, slot->name,
drivers/pci/pci.c +3 -2
@@ -4865,8 +4865,9 @@ static int pci_reset_hotplug_slot(struct hotplug_slot *hotplug, bool probe)static int pci_dev_reset_slot_function (struct pci_dev *dev,bool probe) { -if (dev->multifunction || dev->subordinate || !dev->slot || - dev->dev_flags &PCI_DEV_FLAGS_NO_BUS_RESET ) +if (dev->subordinate || !dev->slot || + dev->dev_flags &PCI_DEV_FLAGS_NO_BUS_RESET || + (dev->multifunction && !dev->slot->per_func_slot))return -ENOTTY ;return pci_reset_hotplug_slot (dev->slot->hotplug, probe);
drivers/pci/slot.c +25 -8
@@ -37,7 +37,7 @@ static const struct sysfs_ops pci_slot_sysfs_ops = {static ssize_t address_read_file (struct pci_slot *slot,char *buf) { -if (slot->number ==0xff ) +if (slot->number == (u16 )PCI_SLOT_PLACEHOLDER )return sysfs_emit (buf,"%04x:%02x\n" ,pci_domain_nr (slot->bus), slot->bus->number);
@@ -72,6 +72,23 @@ static ssize_t cur_speed_read_file(struct pci_slot *slot, char *buf)return bus_speed_read (slot->bus->cur_bus_speed, buf); } +static bool pci_dev_matches_slot (struct pci_dev *dev,struct pci_slot *slot) +{ +if (slot->per_func_slot) +return dev->devfn == slot->number; + +return slot->number ==PCI_SLOT_ALL_DEVICES || +PCI_SLOT (dev->devfn) == slot->number; +} + +static bool pci_slot_enabled_per_func (void ) +{ +if (IS_ENABLED (CONFIG_S390 )) +return true; + +return false; +} +static void pci_slot_release (struct kobject *kobj) {struct pci_dev *dev;
@@ -82,8 +99,7 @@ static void pci_slot_release(struct kobject *kobj)down_read (&pci_bus_sem);list_for_each_entry (dev, &slot->bus->devices, bus_list) -if (slot->number ==PCI_SLOT_ALL_DEVICES || -PCI_SLOT (dev->devfn) == slot->number) +if (pci_dev_matches_slot (dev, slot)) dev->slot =NULL ;up_read (&pci_bus_sem);
@@ -187,8 +203,7 @@ void pci_dev_assign_slot(struct pci_dev *dev)mutex_lock (&pci_slot_mutex);list_for_each_entry (slot, &dev->bus->slots, list) -if (slot->number ==PCI_SLOT_ALL_DEVICES || -PCI_SLOT (dev->devfn) == slot->number) +if (pci_dev_matches_slot (dev, slot)) dev->slot = slot;mutex_unlock (&pci_slot_mutex); }
@@ -267,7 +282,7 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,mutex_lock (&pci_slot_mutex); -if (slot_nr ==-1 ) +if (slot_nr ==PCI_SLOT_PLACEHOLDER ) goto placeholder;/*
@@ -298,6 +313,9 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, slot->bus =pci_bus_get (parent); slot->number = slot_nr; +if (pci_slot_enabled_per_func ()) + slot->per_func_slot =1 ; + slot->kobj.kset = pci_slots_kset; slot_name =make_slot_name (name);
@@ -318,8 +336,7 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,down_read (&pci_bus_sem);list_for_each_entry (dev, &parent->devices, bus_list) -if (slot_nr ==PCI_SLOT_ALL_DEVICES || -PCI_SLOT (dev->devfn) == slot_nr) +if (pci_dev_matches_slot (dev, slot)) dev->slot = slot;up_read (&pci_bus_sem);
include/linux/pci.h +6 -2
@@ -78,14 +78,18 @@* and, if ARI Forwarding is enabled, functions may appear to be on multiple * devices. */ -#define PCI_SLOT_ALL_DEVICES 0xfe +#define PCI_SLOT_ALL_DEVICES 0xfeff + +/* Used to identify a slot as a placeholder */ +#define PCI_SLOT_PLACEHOLDER -1/* pci_slot represents a physical slot */ struct pci_slot {struct pci_bus *bus;/* Bus this slot is on */ struct list_head list;/* Node in list of slots */ struct hotplug_slot *hotplug;/* Hotplug info (move here) */ -unsigned char number;/* Device nr, or PCI_SLOT_ALL_DEVICES */ +u16 number;/* Device nr, or PCI_SLOT_ALL_DEVICES */ +unsigned int per_func_slot:1 ;/* Allow per function slot */ struct kobject kobj; };
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 2/7 PCI: Avoid saving config space state if inaccessible
In reply to Farhan AliThe current reset process saves the device's config space state before reset and restores it afterward. However errors may occur unexpectedly and it may then be impossible to save config space because the device may be inaccessible (e.g. DPC). This results in saving invalid values that get written back to the device during state restoration.
With a reset we want to recover/restore the device into a functional state. So avoid saving the state of the config space when the device config space is inaccessible.
--- drivers/pci/pci.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/pci/pci.c +24 -0
@@ -722,6 +722,27 @@ u16 pci_find_dvsec_capability(struct pci_dev *dev, u16 vendor, u16 dvsec) }EXPORT_SYMBOL_GPL (pci_find_dvsec_capability); +static bool pci_dev_config_accessible (struct pci_dev *dev,char *msg) +{ +u32 val; + +/* +* If device's config space is inaccessible it can return ~0 for +* any reads. Since VFs can also return ~0 for Device and Vendor ID +* check Command and Status registers. Note that this is racy +* because the device may become inaccessible partway through +* next access. +*/ +pci_read_config_dword (dev,PCI_COMMAND , &val); +if (PCI_POSSIBLE_ERROR (val)) { +pci_warn (dev,"Device config space inaccessible; unable to %s\n" , + msg); +return false; + } + +return true; +} +/** * pci_find_parent_resource - return resource region of parent bus of given * region
@@ -5027,6 +5048,9 @@ static void pci_dev_save_and_disable(struct pci_dev *dev)*/ pci_set_power_state (dev,PCI_D0 ); +if (!pci_dev_config_accessible (dev,"save state" )) +return ; +pci_save_state (dev);/* * Disable the device by clearing the Command register, except for
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 3/7 PCI: Fail FLR when config space is inaccessible
In reply to Farhan AliIf a device is in an error state, then it's config space may not be accssible. Add additional check to validate if a device's config space is accessible before doing an FLR reset.
--- drivers/pci/pci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pci/pci.c +3 -0
@@ -4396,6 +4396,9 @@ int pcie_reset_flr(struct pci_dev *dev, bool probe)if (!(dev->devcap &PCI_EXP_DEVCAP_FLR ))return -ENOTTY ; +if (!pci_dev_config_accessible (dev,"FLR" )) +return -ENOTTY ; +if (probe)return 0 ;
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 4/7 s390/pci: Store PCI error information for passthrough devices
In reply to Farhan AliFor a passthrough device we need co-operation from user space to recover the device. This would require to bubble up any error information to user space. Let's store this error information for passthrough devices, so it can be retrieved later.
We can now have userspace drivers (vfio-pci based) on s390x. The userspace drivers will not have any KVM fd and so no kzdev associated with them. So we need to update the logic for detecting passthrough devices to not depend on struct kvm_zdev.
--- arch/s390/include/asm/pci.h | 30 ++++++++ arch/s390/pci/pci.c | 1 + arch/s390/pci/pci_event.c | 116 +++++++++++++++++-------------- drivers/vfio/pci/vfio_pci_zdev.c | 18 ++++- 4 files changed, 111 insertions(+), 54 deletions(-)
arch/s390/include/asm/pci.h +30 -0
@@ -118,6 +118,32 @@ struct zpci_bus {enum pci_bus_speed max_bus_speed; }; +/* Content Code Description for PCI Function Error */ +struct zpci_ccdf_err { +u32 reserved1; +u32 fh;/* function handle */ +u32 fid;/* function id */ +u32 ett :4 ;/* expected table type */ +u32 mvn :12 ;/* MSI vector number */ +u32 dmaas :8 ;/* DMA address space */ +u32 reserved2 :6 ; +u32 q :1 ;/* event qualifier */ +u32 rw :1 ;/* read/write */ +u64 faddr;/* failing address */ +u32 reserved3; +u16 reserved4; +u16 pec;/* PCI event code */ +} __packed; + +#define ZPCI_ERR_PENDING_MAX 4 +struct zpci_ccdf_pending { +bool mediated_recovery; +u8 count; +u8 head; +u8 tail; +struct zpci_ccdf_err err[ZPCI_ERR_PENDING_MAX ]; +}; +/* Private data per function */ struct zpci_dev {struct zpci_bus *zbus;
@@ -192,6 +218,8 @@ struct zpci_dev {struct iommu_domain *s390_domain;/* attached IOMMU domain */ struct kvm_zdev *kzdev;struct mutex kzdev_lock; +struct zpci_ccdf_pending pending_errs; +struct mutex pending_errs_lock;spinlock_t dom_lock;/* protect s390_domain change */ };
@@ -334,6 +362,8 @@ void zpci_debug_exit_device(struct zpci_dev *);int zpci_report_error (struct pci_dev *,struct zpci_report_error_header *);int zpci_clear_error_state (struct zpci_dev *zdev);int zpci_reset_load_store_blocked (struct zpci_dev *zdev); +void zpci_start_mediated_recovery (struct zpci_dev *zdev); +void zpci_stop_mediated_recovery (struct zpci_dev *zdev);#ifdef CONFIG_NUMA
arch/s390/pci/pci.c +1 -0
@@ -842,6 +842,7 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state)mutex_init (&zdev->state_lock);mutex_init (&zdev->fmb_lock);mutex_init (&zdev->kzdev_lock); +mutex_init (&zdev->pending_errs_lock);return zdev;
arch/s390/pci/pci_event.c +65 -51
186 lines not on this page · raw message
drivers/vfio/pci/vfio_pci_zdev.c +15 -3
@@ -144,24 +144,36 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev) {struct zpci_dev *zdev =to_zpci (vdev->pdev); +int ret;if (!zdev)return -ENODEV ; +zpci_start_mediated_recovery (zdev); +if (!vdev->vdev.kvm)return 0 ; + ret = -ENOENT ;if (zpci_kvm_hook.kvm_register) -return zpci_kvm_hook.kvm_register (zdev, vdev->vdev.kvm); + ret = zpci_kvm_hook.kvm_register (zdev, vdev->vdev.kvm); -return -ENOENT ; +if (ret) +zpci_stop_mediated_recovery (zdev); + +return ret; }void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev) {struct zpci_dev *zdev =to_zpci (vdev->pdev); -if (!zdev || !vdev->vdev.kvm) +if (!zdev) +return ; + +zpci_stop_mediated_recovery (zdev); + +if (!vdev->vdev.kvm)return ;if (zpci_kvm_hook.kvm_unregister)
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 5/7 vfio-pci/zdev: Add a device feature for error information
In reply to Farhan AliFor zPCI devices, we have platform specific error information. The platform firmware provides this error information to the operating system in an architecture specific mechanism. To enable recovery from userspace for these devices, we want to expose this error information to userspace. Add a new device feature to expose this information.
--- arch/s390/include/asm/pci.h | 2 ++ arch/s390/pci/pci_event.c | 19 ++++++++++++++++ drivers/vfio/pci/vfio_pci_core.c | 2 ++ drivers/vfio/pci/vfio_pci_priv.h | 9 ++++++++ drivers/vfio/pci/vfio_pci_zdev.c | 39 ++++++++++++++++++++++++++++++++ include/uapi/linux/vfio.h | 30 ++++++++++++++++++++++++ 6 files changed, 101 insertions(+)
arch/s390/include/asm/pci.h +2 -0
@@ -364,6 +364,8 @@ int zpci_clear_error_state(struct zpci_dev *zdev);int zpci_reset_load_store_blocked (struct zpci_dev *zdev);void zpci_start_mediated_recovery (struct zpci_dev *zdev);void zpci_stop_mediated_recovery (struct zpci_dev *zdev); +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf);#ifdef CONFIG_NUMA
arch/s390/pci/pci_event.c +19 -0
@@ -75,6 +75,25 @@ static int zpci_store_pci_error(struct pci_dev *pdev,return 0 ; } +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf) +{ +int head =0 ; + +guard (mutex)(&zdev->pending_errs_lock); + +if (!zdev->pending_errs.count) +return -ENOMSG ; + + head = zdev->pending_errs.head %ZPCI_ERR_PENDING_MAX ; +memcpy (ccdf, &zdev->pending_errs.err[head], +sizeof (struct zpci_ccdf_err )); + zdev->pending_errs.head++; + zdev->pending_errs.count--; +return 0 ; +} +EXPORT_SYMBOL_GPL (zpci_get_pending_error); +void zpci_start_mediated_recovery (struct zpci_dev *zdev) {guard (mutex)(&zdev->pending_errs_lock);
drivers/vfio/pci/vfio_pci_core.c +2 -0
@@ -1569,6 +1569,8 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,return vfio_pci_core_feature_token (vdev, flags, arg, argsz);case VFIO_DEVICE_FEATURE_DMA_BUF :return vfio_pci_core_feature_dma_buf (vdev, flags, arg, argsz); +case VFIO_DEVICE_FEATURE_ZPCI_ERROR : +return vfio_pci_zdev_feature_err (device, flags, arg, argsz);default :return -ENOTTY ; }
drivers/vfio/pci/vfio_pci_priv.h +9 -0
@@ -93,6 +93,8 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, struct vfio_info_cap *caps);int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev);void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev); +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz);#else static inline int vfio_pci_info_zdev_add_caps (struct vfio_pci_core_device *vdev,struct vfio_info_cap *caps)
@@ -107,6 +109,13 @@ static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)static inline void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev) {} + +static inline int vfio_pci_zdev_feature_err (struct vfio_device *device, +u32 flags,void __user *arg, +size_t argsz) +{ +return -ENOTTY ; +}#endif static inline bool vfio_pci_is_vga (struct pci_dev *pdev)
drivers/vfio/pci/vfio_pci_zdev.c +39 -0
@@ -141,6 +141,45 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,return ret; } +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz) +{ +struct vfio_device_feature_zpci_err err = {}; +struct vfio_pci_core_device *vdev; +struct zpci_ccdf_err ccdf = {}; +struct zpci_dev *zdev; +int ret; + + vdev = container_of(device, struct vfio_pci_core_device, vdev); + zdev =to_zpci (vdev->pdev); +if (!zdev) +return -ENODEV ; + + ret =vfio_check_feature (flags, argsz,VFIO_DEVICE_FEATURE_GET , +sizeof (err)); +if (ret !=1 ) +return ret; + + ret =zpci_get_pending_error (zdev, &ccdf); +if (ret) +return ret; + + err.fh = ccdf.fh; + err.fid = ccdf.fid; + err.ett = ccdf.ett; + err.mvn = ccdf.mvn; + err.dmaas = ccdf.dmaas; + err.q = ccdf.q; + err.rw = ccdf.rw; + err.faddr = ccdf.faddr; + err.pec = ccdf.pec; + +if (copy_to_user (arg, &err,sizeof (err))) +return -EFAULT ; + +return 0 ; +} +int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev) {struct zpci_dev *zdev =to_zpci (vdev->pdev);
include/uapi/linux/vfio.h +30 -0
@@ -1534,6 +1534,36 @@ struct vfio_device_feature_dma_buf {*/ #define VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 12 +/** +* VFIO_DEVICE_FEATURE_ZPCI_ERROR feature provides PCI error information to +* userspace for vfio-pci devices on s390. On s390, PCI error recovery +* involves platform firmware and notification to operating systems is done +* by architecture specific mechanism. Exposing this information to +* userspace allows it to take appropriate actions to handle an +* error on the device. The ioctl returns -ENOMSG if there are no pending +* PCI errors. +*/ + +struct vfio_device_feature_zpci_err { +__u32 feature_flags;/* Indicate future features */ +__u32 reserved1; +__u32 fh;/* function handle */ +__u32 fid;/* function id */ +__u32 ett :4 ;/* expected table type */ +__u32 mvn :12 ;/* MSI vector number */ +__u32 dmaas :8 ;/* DMA address space */ +__u32 reserved2 :6 ; +__u32 q :1 ;/* event qualifier */ +__u32 rw :1 ;/* read/write */ +__u64 faddr;/* failing address */ +__u32 reserved3; +__u16 reserved4; +__u16 pec;/* PCI event code */ +__u8 reserved5[28 ];/* Allow for future expansion */ +}; + +#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13 +/* -------- API for Type1 VFIO IOMMU -------- */ /**
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 6/7 vfio/pci: Add a reset_done callback for vfio-pci driver
In reply to Farhan AliOn error recovery for a PCI device bound to vfio-pci driver, we want to recover the state of the device to its last known saved state. The callback restores the state of the device to its initial saved state.
--- drivers/vfio/pci/vfio_pci_core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/vfio/pci/vfio_pci_core.c +12 -0
@@ -2290,6 +2290,17 @@ pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev, }EXPORT_SYMBOL_GPL (vfio_pci_core_aer_err_detected); +static void vfio_pci_core_aer_reset_done (struct pci_dev *pdev) +{ +struct vfio_pci_core_device *vdev =dev_get_drvdata (&pdev->dev); + +if (!vdev->pci_saved_state) +return ; + +pci_load_saved_state (pdev, vdev->pci_saved_state); +pci_restore_state (pdev); +} +int vfio_pci_core_sriov_configure (struct vfio_pci_core_device *vdev,int nr_virtfn) {
@@ -2354,6 +2365,7 @@ EXPORT_SYMBOL_GPL(vfio_pci_core_sriov_configure);const struct pci_error_handlers vfio_pci_core_err_handlers = { .error_detected = vfio_pci_core_aer_err_detected, + .reset_done = vfio_pci_core_aer_reset_done, };EXPORT_SYMBOL_GPL (vfio_pci_core_err_handlers);
Signature · 1 line
2.43.0
Farhan Ali
maintainerPATCH v17 7/7 vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX
In reply to Farhan AliThe error signaling is configured for the vast majority of devices and it's extremely rare that it fires anyway. Removing the pcie check will allow userspace to be notified on errors for legacy PCI devices. The Internal Shared Memory (ISM) device on s390 is one such device. For PCI devices on IBM s390 error recovery involves platform firmware and notification to operating system is done by architecture specific way. So the ISM device can still be recovered when notified of an error.
--- drivers/vfio/pci/vfio_pci_core.c | 8 ++------ drivers/vfio/pci/vfio_pci_intrs.c | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-)
drivers/vfio/pci/vfio_pci_core.c +2 -6
@@ -821,8 +821,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_core_device *vdev, int irq_typreturn (flags &PCI_MSIX_FLAGS_QSIZE ) +1 ; } }else if (irq_type ==VFIO_PCI_ERR_IRQ_INDEX ) { -if (pci_is_pcie (vdev->pdev)) -return 1 ; +return 1 ; }else if (irq_type ==VFIO_PCI_REQ_IRQ_INDEX ) {return 1 ; }
@@ -1198,11 +1197,8 @@ static int vfio_pci_ioctl_get_irq_info(struct vfio_pci_core_device *vdev,switch (info.index) { case VFIO_PCI_INTX_IRQ_INDEX ... VFIO_PCI_MSIX_IRQ_INDEX:case VFIO_PCI_REQ_IRQ_INDEX : -break ;case VFIO_PCI_ERR_IRQ_INDEX : -if (pci_is_pcie (vdev->pdev)) -break ; - fallthrough; +break ;default :return -EINVAL ; }
drivers/vfio/pci/vfio_pci_intrs.c +1 -2
@@ -859,8 +859,7 @@ int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, uint32_t flags,case VFIO_PCI_ERR_IRQ_INDEX :switch (flags &VFIO_IRQ_SET_ACTION_TYPE_MASK ) {case VFIO_IRQ_SET_ACTION_TRIGGER : -if (pci_is_pcie (vdev->pdev)) - func = vfio_pci_set_err_trigger; + func = vfio_pci_set_err_trigger;break ; }break ;
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v17 1/7] PCI: Allow per function PCI slots to fix slot reset on s390
In reply to Farhan AliThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Lockless access and double-dereference of dev->slot in pci_dev_reset_slot_function() can lead to a TOCTOU race resulting in a Use-After-Free or NULL pointer dereference. --
commit 3e69d6bfb3fdb198ceb79bc29354354788895096
Author: Farhan Ali <[email protected]>
PCI: Allow per function PCI slots to fix slot reset on s390
This commit introduces a per_func_slot flag to struct pci_slot to allow per-function PCI slots for functions managed through a hypervisor, such as on s390. It modifies slot matching logic and pci_dev_reset_slot_function() to account for this new behavior.
[ ... ]
drivers/pci/pci.c static int pci_reset_hotplug_slot(struct hotplug_slot *hotplug, bool probe) · line 4870
Quoted 13 lines
drivers/pci/pci.c +3
-2@@ -4865,8 +4865,9 @@ static int pci_reset_hotplug_slot(struct hotplug_slot *hotplug, bool probe)static int pci_dev_reset_slot_function (struct pci_dev *dev,bool probe) { -if (dev->multifunction || dev->subordinate || !dev->slot || - dev->dev_flags &PCI_DEV_FLAGS_NO_BUS_RESET ) +if (dev->subordinate || !dev->slot || + dev->dev_flags &PCI_DEV_FLAGS_NO_BUS_RESET || + (dev->multifunction && !dev->slot->per_func_slot))
[Severity: High]
This is a pre-existing issue, but does this lockless access to dev->slot introduce a time-of-check to time-of-use race condition?
Because dev->slot is read without holding pci_slot_mutex or device_lock(), a concurrent hotplug removal could clear dev->slot and free the slot structure in pci_slot_release() while this code is running.
If the compiler reloads the pointer after the !dev->slot check, or if the pointer is kept in a register while the memory is freed, could accessing dev->slot->per_func_slot or dev->slot->hotplug below result in a null pointer dereference or use-after-free?
Quoted 3 lines
drivers/pci/pci.c +0
-0return -ENOTTY ;return pci_reset_hotplug_slot (dev->slot->hotplug, probe);
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AI reviewRe: [PATCH v17 2/7] PCI: Avoid saving config space state if inaccessible
In reply to Farhan AliThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Incomplete Device Disable / Race Condition - [Low] Const Correctness violation in helper function…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Incomplete Device Disable / Race Condition
- [Low] Const Correctness violation in helper function signature
--
commit 914208ab22fdc2baa5a5a849742b75582c456d5e
Author: Farhan Ali <[email protected]>
PCI: Avoid saving config space state if inaccessible
This commit avoids saving the device's config space state before reset if the device is inaccessible. This prevents saving invalid values that could get written back to the device during state restoration.
Quoted 4 lines
drivers/pci/pci.c +0
-0
[ ... ]
drivers/pci/pci.c u16 pci_find_dvsec_capability(struct pci_dev *dev, u16 vendor, u16 dvsec) · line 725
Quoted 5 lines
drivers/pci/pci.c +1
-0@@ -722,6 +722,27 @@ u16 pci_find_dvsec_capability(struct pci_dev *dev, u16 vendor, u16 dvsec) }EXPORT_SYMBOL_GPL (pci_find_dvsec_capability); +static bool pci_dev_config_accessible (struct pci_dev *dev,char *msg)
[Severity: Low]
This isn't a bug, but should this parameter be declared as const char *msg?
The function is passed a string literal "save state" by its caller, which can lead to compiler warnings about discarding the const qualifier.
Quoted 2 lines
drivers/pci/pci.c +2
-0+{ +u32 val;
[ ... ]
drivers/pci/pci.c static void pci_dev_save_and_disable(struct pci_dev *dev) · line 5053
Quoted 7 lines
drivers/pci/pci.c +3
-0@@ -5027,6 +5048,9 @@ static void pci_dev_save_and_disable(struct pci_dev *dev)*/ pci_set_power_state (dev,PCI_D0 ); +if (!pci_dev_config_accessible (dev,"save state" )) +return ; +
[Severity: High]
Does returning early here skip disabling the device in the lines that follow?
Because hardware state changes asynchronously, a device might be transiently inaccessible during this check but recover immediately after.
If the function returns early here, it skips the subsequent pci_write_config_word() call that disables Bus Master and legacy INTx:
pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE);
Could this leave a recovered device with Bus Master enabled during the reset procedure and risk unintended DMA?
Should the pci_dev_config_accessible() check only guard pci_save_state(), so the kernel always attempts the disable operation?
Quoted 3 lines
drivers/pci/pci.c +0
-0pci_save_state (dev);/* * Disable the device by clearing the Command register, except for
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v17 4/7] s390/pci: Store PCI error information for passthrough devices
In reply to Farhan AliQuoted 10 lines · Farhan Ali
For a passthrough device we need co-operation from user space to recover the device. This would require to bubble up any error information to user space. Let's store this error information for passthrough devices, so it can be retrieved later.
We can now have userspace drivers (vfio-pci based) on s390x. The userspace drivers will not have any KVM fd and so no kzdev associated with them. So we need to update the logic for detecting passthrough devices to not depend on struct
kvm_zdev.
Quoted 9 lines
Reviewed-by Matthew Rosato <[email protected]>Signed-off-by Farhan Ali <[email protected]>--- arch/s390/include/asm/pci.h | 30 ++++++++ arch/s390/pci/pci.c | 1 + arch/s390/pci/pci_event.c | 116 +++++++++++++++++-------------- drivers/vfio/pci/vfio_pci_zdev.c | 18 ++++- 4 files changed, 111 insertions(+), 54 deletions(-)
Looks good to me now and I do think the zpci_store_pci_error() makes the code easier to read and gives a clear destinction for mediated recovery mode. Oh and Sashiko just came back with no issues found too.
Feel free to add my:
Thanks,
Niklas
[email protected]
AI reviewRe: [PATCH v17 5/7] vfio-pci/zdev: Add a device feature for error information
In reply to Farhan AliThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] The newly introduced UAPI structure `struct vfio_device_feature_zpci_err` uses C bitfields and…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The newly introduced UAPI structure struct vfio_device_feature_zpci_err uses C bitfields and contains implicit compiler padding, violating standard Linux UAPI design principles.
- [Medium] Pending PCI error events are permanently lost if copy_to_user fails, because the event is destructively dequeued from the kernel ring buffer prior to the copy. --
commit a4660375ffb0dd291a17be2bdc78cd55dbb931ab
Author: Farhan Ali <[email protected]>
vfio-pci/zdev: Add a device feature for error information
This commit adds a new device feature to expose platform-specific zPCI error information to userspace. This allows userspace to handle errors and perform recovery for these devices.
Quoted 4 lines
drivers/vfio/pci/vfio_pci_zdev.c +0
-0
[ ... ]
Quoted 7 lines
drivers/vfio/pci/vfio_pci_zdev.c +3
-0@@ -141,6 +141,45 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,return ret; } +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz) +{
[ ... ]
Quoted 6 lines
drivers/vfio/pci/vfio_pci_zdev.c +6
-0+ ret =zpci_get_pending_error (zdev, &ccdf); +if (ret) +return ret; + + err.fh = ccdf.fh; + err.fid = ccdf.fid;
drivers/vfio/pci/vfio_pci_zdev.c int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, · line 178
Quoted 10 lines
drivers/vfio/pci/vfio_pci_zdev.c +10
-0+ err.ett = ccdf.ett; + err.mvn = ccdf.mvn; + err.dmaas = ccdf.dmaas; + err.q = ccdf.q; + err.rw = ccdf.rw; + err.faddr = ccdf.faddr; + err.pec = ccdf.pec; + +if (copy_to_user (arg, &err,sizeof (err))) +return -EFAULT ;
[Severity: Medium]
If copy_to_user() fails here, is the pending PCI error permanently lost?
Looking at zpci_get_pending_error() introduced earlier in this patch, it destructively dequeues the event by advancing the head pointer and decrementing the count:
arch/s390/pci/pci_event.c:zpci_get_pending_error() {
...
zdev->pending_errs.head++;
zdev->pending_errs.count--;
return 0;
}Returning -EFAULT after this point leaves the event discarded completely. Would it be better to only dequeue the event from the ring buffer after verifying the transfer to userspace succeeds?
[ ... ]
Quoted 4 lines
include/uapi/linux/vfio.h +0
-0
[ ... ]
Quoted 7 lines
include/uapi/linux/vfio.h +7
-0+struct vfio_device_feature_zpci_err { +__u32 feature_flags;/* Indicate future features */ +__u32 reserved1; +__u32 fh;/* function handle */ +__u32 fid;/* function id */ +__u32 ett :4 ;/* expected table type */ +__u32 mvn :12 ;/* MSI vector number */
include/uapi/linux/vfio.h struct vfio_device_feature_dma_buf { · line 1563
Quoted 10 lines
include/uapi/linux/vfio.h +10
-0+ __u32 dmaas : 8; /* DMA address space */ + __u32 reserved2 : 6; + __u32 q : 1; /* event qualifier */ + __u32 rw : 1; /* read/write */ +__u64 faddr;/* failing address */ +__u32 reserved3; +__u16 reserved4; +__u16 pec;/* PCI event code */ +__u8 reserved5[28 ];/* Allow for future expansion */ +};
[Severity: Medium]
Does this UAPI structure rely on compiler-dependent C bitfields?
Since bit-ordering and layout for bitfields are not strictly guaranteed across toolchains, would it be safer to use explicit integer types combined with bitmask macros for this UAPI design?
Additionally, does this layout introduce implicit compiler padding gaps before the 8-byte aligned faddr field, and at the end of the struct?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
[email protected]
AI reviewRe: [PATCH v17 6/7] vfio/pci: Add a reset_done callback for vfio-pci driver
In reply to Farhan AliThank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Critical] Use-After-Free (UAF) due to lockless Time-of-Check to Time-of-Use (TOCTOU) race on…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] Use-After-Free (UAF) due to lockless Time-of-Check to Time-of-Use (TOCTOU) race on vdev->pci_saved_state
- [High] Hardware state modification via pci_restore_state() without acquiring vdev->memory_lock
- [Medium] Missing error check on pci_load_saved_state() leads to potential data corruption
--
commit 23e4483480775e0803e490cec805fe1688f9a753
Author: Farhan Ali <[email protected]>
vfio/pci: Add a reset_done callback for vfio-pci driver
This commit adds a reset_done callback to the vfio-pci driver's error handlers to restore the PCI device state to its initial saved state upon error recovery.
Quoted 4 lines
drivers/vfio/pci/vfio_pci_core.c +0
-0
[ ... ]
drivers/vfio/pci/vfio_pci_core.c pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev, · line 2262
Quoted 9 lines
drivers/vfio/pci/vfio_pci_core.c +5
-0@@ -2255,6 +2255,17 @@ pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev, }EXPORT_SYMBOL_GPL (vfio_pci_core_aer_err_detected); +static void vfio_pci_core_aer_reset_done (struct pci_dev *pdev) +{ +struct vfio_pci_core_device *vdev =dev_get_drvdata (&pdev->dev); + +if (!vdev->pci_saved_state)
[Severity: Critical]
Is there a race condition here if userspace closes the VFIO device file descriptor concurrently?
This callback checks vdev->pci_saved_state without holding any VFIO-specific locks. If vfio_pci_core_disable() is called concurrently, it can free the state using pci_load_and_free_saved_state(&vdev->pci_saved_state).
If the memory is freed right after this check passes, will pci_load_saved_state() dereference a freed pointer?
drivers/vfio/pci/vfio_pci_core.c pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev, · line 2300
Quoted 3 lines
drivers/vfio/pci/vfio_pci_core.c +3
-0+return ; + +pci_load_saved_state (pdev, vdev->pci_saved_state);
[Severity: Medium]
Should we check the return value of pci_load_saved_state() here?
If the saved PCI capabilities do not match the current hardware capabilities, pci_load_saved_state() can fail and return a negative error code like -EINVAL.
When this fails, it sets pdev->state_saved = false and leaves pdev->saved_config_space and pdev->saved_cap_space in an incomplete or partially updated state. Since this code unconditionally calls pci_restore_state() next, could it restore a corrupted or incomplete configuration state to the physical hardware device?
drivers/vfio/pci/vfio_pci_core.c pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev, · line 2301
Quoted 1 line
drivers/vfio/pci/vfio_pci_core.c +1
-0+pci_restore_state (pdev);
[Severity: High]
Does this hardware state modification require vdev->memory_lock?
pci_restore_state() modifies fundamental hardware state like the PCI COMMAND register and BARs. In the vfio-pci driver, operations that modify or reset the device's memory decode bits typically require the vdev->memory_lock read-write semaphore to protect against concurrent userspace memory-mapped I/O faults and configuration accesses.
Because this lock is not held, can concurrent userspace accesses interleave with the hardware state restoration, potentially leading to memory corruption or unisolated memory access?
However, simply adding down_write(&vdev->memory_lock) here might cause a recursive deadlock during VFIO_DEVICE_RESET, which already holds memory_lock before triggering the reset sequence that calls this callback. Is there a way to safely serialize this hardware state modification?
Quoted 2 lines
drivers/vfio/pci/vfio_pci_core.c +2
-0+} +
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
Farhan Ali
maintainerPolite ping on the series :)
Thanks
Farhan
Quoted 121 lines · Farhan Ali
Hi,
This Linux kernel patch series introduces support for error recovery for passthrough PCI devices on System Z (s390x).
Background
----------
For PCI devices on s390x an operating system receives platform specific error events from firmware rather than through AER.Today for passthrough/userspace devices, we don't attempt any error recovery and ignore any error events for the devices. The passthrough/userspace devices are managed by the vfio-pci driver. The driver does register error handling callbacks (error_detected), and on an error trigger an eventfd to userspace. But we need a mechanism to notify userspace (QEMU/guest/userspace drivers) about the error event.Proposal
--------
We can expose this error information (currently only the PCI Error Code) via a device feature. Userspace can then obtain the error information viaVFIO_DEVICE_FEATUREioctl and take appropriate actions such as driving a device reset.This is how a typical flow for passthrough devices to a VM would work:
For passthrough devices to a VM, the driver bound to the device on the host is vfio-pci. vfio-pci driver does support theerror_detected()callback (vfio_pci_core_aer_err_detected()), and on an PCI error s390x recovery code on the host will call the vfio-pcierror_detected()callback. The vfio-pcierror_detected()callback will notify userspace/QEMU via an eventfd, and returnPCI_ERS_RESULT_CAN_RECOVER. At this point the s390x error recovery on the host will skip any further action(see patch 4) and let userspace drive the error recovery.Once userspace/QEMU is notified, it then injects this error into the VM so device drivers in the VM can take recovery actions. For example for a passthrough NVMe device, the VM's OS NVMe driver will access the device. At this point the VM's NVMe driver's
error_detected()will drive the recovery by returningPCI_ERS_RESULT_NEED_RESET, and the s390x error recovery in the VM's OS will try to do a reset. Resets are privileged operations and so the VM will need intervention from QEMU to perform the reset. QEMU will invoke theVFIO_DEVICE_RESETioctl to now notify the host that the VM is requesting a reset of the device. The vfio-pci driver on the host will then perform the reset on the device to recover it.Thanks
FarhanChangeLog
---------
This only includes change log from last 5 revision. Older change log is available in previous version cover letter.v16 https://lore.kernel.org/all/[email protected]/
v16 -> v17
- Handle ENOMEM case and remove unnecessarymutex_unlock(patch 4).
- Rebase on 7.1-rc4v15 https://lore.kernel.org/all/[email protected]/
v15 -> v16
- Implement error recovery to be handled in user space mode or host mode based on checkingmediated_recoveryonly once (suggested by Niklas).- Rebase on 7.1-rc3
v14 https://lore.kernel.org/all/[email protected]/
v14 -> v15
- Fix issues identified by Sashiko (patch 4).- Address Niklas feedback (patch 4 and patch 5).
- Rebase on 7.1-rc2.
v13 series https://lore.kernel.org/all/[email protected]/
v13 -> v14
- Remove version from vfio uAPI struct. Instead reserve additional space and add a flags field. The flags will be used to indicate any usage of the reserved space (patch 5).- Remove
pending_errorsfrom vfio uAPI struct and instead return an error to indicate no more pending error for userspace to handle (patch 5).- Rebase on recent linux master
v12 series https://lore.kernel.org/all/[email protected]/
v12 -> v13
- Add themediated_recoveryflag as part of structzpci_ccdf_pendingand protect the struct withpending_errs_lock(patch 4).- Move dequeing pending error logic to a helper function (patch 5).
- Update device feature number for
VFIO_DEVICE_FEATURE_ZPCI_ERROR(patch 5).- Rebase on linux-next with tag next-20260410
Farhan Ali (7):
PCI: Allow per function PCI slots to fix slot reset on s390
PCI: Avoid saving config space state if inaccessible
PCI: Fail FLR when config space is inaccessible s390/pci: Store PCI error information for passthrough devices vfio-pci/zdev: Add a device feature for error information vfio/pci: Add areset_donecallback for vfio-pci driver vfio/pci: Remove the pcie check forVFIO_PCI_ERR_IRQ_INDEXarch/s390/include/asm/pci.h | 32 +++++++ arch/s390/pci/pci.c | 1 + arch/s390/pci/pci_event.c | 135 +++++++++++++++++++----------- drivers/pci/hotplug/rpaphp_slot.c | 2 +- drivers/pci/pci.c | 32 ++++++- drivers/pci/slot.c | 33 ++++++-- drivers/vfio/pci/vfio_pci_core.c | 22 +++-- drivers/vfio/pci/vfio_pci_intrs.c | 3 +- drivers/vfio/pci/vfio_pci_priv.h | 9 ++ drivers/vfio/pci/vfio_pci_zdev.c | 57 ++++++++++++- include/linux/pci.h | 8 +- include/uapi/linux/vfio.h | 30 +++++++ 12 files changed, 289 insertions(+), 75 deletions(-)
Alex Williamson
maintainerRe: [PATCH v17 5/7] vfio-pci/zdev: Add a device feature for error information
In reply to Farhan AliQuoted 137 lines · On Wed, 20 May 2026 10:11:11 -0700 Farhan Ali <[email protected]> wrote:
For zPCI devices, we have platform specific error information. The platform firmware provides this error information to the operating system in an architecture specific mechanism. To enable recovery from userspace for these devices, we want to expose this error information to userspace. Add a new device feature to expose this information.
Reviewed-by Matthew Rosato <[email protected]>Reviewed-by Niklas Schnelle <[email protected]>Signed-off-by Farhan Ali <[email protected]>--- arch/s390/include/asm/pci.h | 2 ++ arch/s390/pci/pci_event.c | 19 ++++++++++++++++ drivers/vfio/pci/vfio_pci_core.c | 2 ++ drivers/vfio/pci/vfio_pci_priv.h | 9 ++++++++ drivers/vfio/pci/vfio_pci_zdev.c | 39 ++++++++++++++++++++++++++++++++ include/uapi/linux/vfio.h | 30 ++++++++++++++++++++++++ 6 files changed, 101 insertions(+)arch/s390/include/asm/pci.h +2
-0@@ -364,6 +364,8 @@ int zpci_clear_error_state(struct zpci_dev *zdev);int zpci_reset_load_store_blocked (struct zpci_dev *zdev);void zpci_start_mediated_recovery (struct zpci_dev *zdev);void zpci_stop_mediated_recovery (struct zpci_dev *zdev); +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf);#ifdef CONFIG_NUMA arch/s390/pci/pci_event.c +19
-0@@ -75,6 +75,25 @@ static int zpci_store_pci_error(struct pci_dev *pdev,return 0 ; } +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf) +{ +int head =0 ; + +guard (mutex)(&zdev->pending_errs_lock); + +if (!zdev->pending_errs.count) +return -ENOMSG ; + + head = zdev->pending_errs.head %ZPCI_ERR_PENDING_MAX ; +memcpy (ccdf, &zdev->pending_errs.err[head], +sizeof (struct zpci_ccdf_err )); + zdev->pending_errs.head++; + zdev->pending_errs.count--; +return 0 ; +} +EXPORT_SYMBOL_GPL (zpci_get_pending_error); +void zpci_start_mediated_recovery (struct zpci_dev *zdev) {guard (mutex)(&zdev->pending_errs_lock);drivers/vfio/pci/vfio_pci_core.c +2
-0@@ -1569,6 +1569,8 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,return vfio_pci_core_feature_token (vdev, flags, arg, argsz);case VFIO_DEVICE_FEATURE_DMA_BUF :return vfio_pci_core_feature_dma_buf (vdev, flags, arg, argsz); +case VFIO_DEVICE_FEATURE_ZPCI_ERROR : +return vfio_pci_zdev_feature_err (device, flags, arg, argsz);default :return -ENOTTY ; }drivers/vfio/pci/vfio_pci_priv.h +9
-0@@ -93,6 +93,8 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, struct vfio_info_cap *caps);int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev);void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev); +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz);#else static inline int vfio_pci_info_zdev_add_caps (struct vfio_pci_core_device *vdev,struct vfio_info_cap *caps)@@ -107,6 +109,13 @@ static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)static inline void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev) {} + +static inline int vfio_pci_zdev_feature_err (struct vfio_device *device, +u32 flags,void __user *arg, +size_t argsz) +{ +return -ENOTTY ; +}#endif static inline bool vfio_pci_is_vga (struct pci_dev *pdev)drivers/vfio/pci/vfio_pci_zdev.c +28
-0@@ -141,6 +141,45 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,return ret; } +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz) +{ +struct vfio_device_feature_zpci_err err = {}; +struct vfio_pci_core_device *vdev; +struct zpci_ccdf_err ccdf = {}; +struct zpci_dev *zdev; +int ret; + + vdev = container_of(device, struct vfio_pci_core_device, vdev); + zdev =to_zpci (vdev->pdev); +if (!zdev) +return -ENODEV ; + + ret =vfio_check_feature (flags, argsz,VFIO_DEVICE_FEATURE_GET , +sizeof (err)); +if (ret !=1 ) +return ret; + + ret =zpci_get_pending_error (zdev, &ccdf); +if (ret) +return ret; + + err.fh = ccdf.fh; + err.fid = ccdf.fid; + err.ett = ccdf.ett; + err.mvn = ccdf.mvn; + err.dmaas = ccdf.dmaas;
drivers/vfio/pci/vfio_pci_zdev.c int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, · line 181
Quoted 10 lines
drivers/vfio/pci/vfio_pci_zdev.c +10
-0+ err.q = ccdf.q; + err.rw = ccdf.rw; + err.faddr = ccdf.faddr; + err.pec = ccdf.pec; + +if (copy_to_user (arg, &err,sizeof (err))) +return -EFAULT ; + +return 0 ; +}
There's a concern here that the error is dequeued but we can still fail resulting in a lost error. Is that a sufficiently unlikely scenario to ignore or should it at least be documented?
Quoted 32 lines
drivers/vfio/pci/vfio_pci_zdev.c +1
-0+int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev) {struct zpci_dev *zdev =to_zpci (vdev->pdev);include/uapi/linux/vfio.h +20
-0@@ -1534,6 +1534,36 @@ struct vfio_device_feature_dma_buf {*/ #define VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 12 +/** +* VFIO_DEVICE_FEATURE_ZPCI_ERROR feature provides PCI error information to +* userspace for vfio-pci devices on s390. On s390, PCI error recovery +* involves platform firmware and notification to operating systems is done +* by architecture specific mechanism. Exposing this information to +* userspace allows it to take appropriate actions to handle an +* error on the device. The ioctl returns -ENOMSG if there are no pending +* PCI errors. +*/ + +struct vfio_device_feature_zpci_err { +__u32 feature_flags;/* Indicate future features */ +__u32 reserved1; +__u32 fh;/* function handle */ +__u32 fid;/* function id */ +__u32 ett :4 ;/* expected table type */ +__u32 mvn :12 ;/* MSI vector number */ +__u32 dmaas :8 ;/* DMA address space */ +__u32 reserved2 :6 ; +__u32 q :1 ;/* event qualifier */
include/uapi/linux/vfio.h struct vfio_device_feature_dma_buf { · line 1566
Quoted 10 lines
include/uapi/linux/vfio.h +10
-0+ __u32 rw : 1; /* read/write */ +__u64 faddr;/* failing address */ +__u32 reserved3; +__u16 reserved4; +__u16 pec;/* PCI event code */ +__u8 reserved5[28 ];/* Allow for future expansion */ +}; + +#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13 +
There are currently at least 4 different patch series, including this one, that are vying for device feature allocations. This series spans PCI, s390, and vfio, and I'm not entirely sure which maintainer should take it. With Niklas' review on patch 4, should we ask Bjorn to take 1-3 through PCI, share a branch, and I could merge 4-7 through vfio? Thanks,
Alex
Farhan Ali
maintainerRe: [PATCH v17 5/7] vfio-pci/zdev: Add a device feature for error information
Quoted 145 lines · Alex Williamson
Quoted 142 lines · On Wed, 20 May 2026 10:11:11 -0700 Farhan Ali <[email protected]> wrote:
For zPCI devices, we have platform specific error information. The platform firmware provides this error information to the operating system in an architecture specific mechanism. To enable recovery from userspace for these devices, we want to expose this error information to userspace. Add a new device feature to expose this information.
Reviewed-by Matthew Rosato <[email protected]>Reviewed-by Niklas Schnelle <[email protected]>Signed-off-by Farhan Ali <[email protected]>--- arch/s390/include/asm/pci.h | 2 ++ arch/s390/pci/pci_event.c | 19 ++++++++++++++++ drivers/vfio/pci/vfio_pci_core.c | 2 ++ drivers/vfio/pci/vfio_pci_priv.h | 9 ++++++++ drivers/vfio/pci/vfio_pci_zdev.c | 39 ++++++++++++++++++++++++++++++++ include/uapi/linux/vfio.h | 30 ++++++++++++++++++++++++ 6 files changed, 101 insertions(+)arch/s390/include/asm/pci.h +2
-0@@ -364,6 +364,8 @@ int zpci_clear_error_state(struct zpci_dev *zdev);int zpci_reset_load_store_blocked (struct zpci_dev *zdev);void zpci_start_mediated_recovery (struct zpci_dev *zdev);void zpci_stop_mediated_recovery (struct zpci_dev *zdev); +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf);#ifdef CONFIG_NUMA arch/s390/pci/pci_event.c +19
-0@@ -75,6 +75,25 @@ static int zpci_store_pci_error(struct pci_dev *pdev,return 0 ; } +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf) +{ +int head =0 ; + +guard (mutex)(&zdev->pending_errs_lock); + +if (!zdev->pending_errs.count) +return -ENOMSG ; + + head = zdev->pending_errs.head %ZPCI_ERR_PENDING_MAX ; +memcpy (ccdf, &zdev->pending_errs.err[head], +sizeof (struct zpci_ccdf_err )); + zdev->pending_errs.head++; + zdev->pending_errs.count--; +return 0 ; +} +EXPORT_SYMBOL_GPL (zpci_get_pending_error); +void zpci_start_mediated_recovery (struct zpci_dev *zdev) {guard (mutex)(&zdev->pending_errs_lock);drivers/vfio/pci/vfio_pci_core.c +2
-0@@ -1569,6 +1569,8 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,return vfio_pci_core_feature_token (vdev, flags, arg, argsz);case VFIO_DEVICE_FEATURE_DMA_BUF :return vfio_pci_core_feature_dma_buf (vdev, flags, arg, argsz); +case VFIO_DEVICE_FEATURE_ZPCI_ERROR : +return vfio_pci_zdev_feature_err (device, flags, arg, argsz);default :return -ENOTTY ; }drivers/vfio/pci/vfio_pci_priv.h +9
-0@@ -93,6 +93,8 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, struct vfio_info_cap *caps);int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev);void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev); +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz);#else static inline int vfio_pci_info_zdev_add_caps (struct vfio_pci_core_device *vdev,struct vfio_info_cap *caps)@@ -107,6 +109,13 @@ static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)static inline void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev) {} + +static inline int vfio_pci_zdev_feature_err (struct vfio_device *device, +u32 flags,void __user *arg, +size_t argsz) +{ +return -ENOTTY ; +}#endif static inline bool vfio_pci_is_vga (struct pci_dev *pdev)drivers/vfio/pci/vfio_pci_zdev.c +33
-0@@ -141,6 +141,45 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,return ret; } +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz) +{ +struct vfio_device_feature_zpci_err err = {}; +struct vfio_pci_core_device *vdev; +struct zpci_ccdf_err ccdf = {}; +struct zpci_dev *zdev; +int ret; + + vdev = container_of(device, struct vfio_pci_core_device, vdev); + zdev =to_zpci (vdev->pdev); +if (!zdev) +return -ENODEV ; + + ret =vfio_check_feature (flags, argsz,VFIO_DEVICE_FEATURE_GET , +sizeof (err)); +if (ret !=1 ) +return ret; + + ret =zpci_get_pending_error (zdev, &ccdf); +if (ret) +return ret; + + err.fh = ccdf.fh; + err.fid = ccdf.fid; + err.ett = ccdf.ett; + err.mvn = ccdf.mvn; + err.dmaas = ccdf.dmaas; + err.q = ccdf.q; + err.rw = ccdf.rw; + err.faddr = ccdf.faddr; + err.pec = ccdf.pec; +
Quoted 8 lines
drivers/vfio/pci/vfio_pci_zdev.c int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, · line 181
Quoted 5 lines
drivers/vfio/pci/vfio_pci_zdev.c +5
-0+if (copy_to_user (arg, &err,sizeof (err))) +return -EFAULT ; + +return 0 ; +}There's a concern here that the error is dequeued but we can still fail resulting in a lost error. Is that a sufficiently unlikely scenario to ignore or should it at least be documented?
IMHO this scenario would be unlikely and could be ignored. I think to handle this we would need something like a peek() API and only remove and update the pending_errs if copy_to_user succeeds. This would be adding more complexity for a relatively low possibility of failure.
Quoted 50 lines
Quoted 33 lines
drivers/vfio/pci/vfio_pci_zdev.c +1
-0+int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev) {struct zpci_dev *zdev =to_zpci (vdev->pdev);include/uapi/linux/vfio.h +20
-0@@ -1534,6 +1534,36 @@ struct vfio_device_feature_dma_buf {*/ #define VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 12 +/** +* VFIO_DEVICE_FEATURE_ZPCI_ERROR feature provides PCI error information to +* userspace for vfio-pci devices on s390. On s390, PCI error recovery +* involves platform firmware and notification to operating systems is done +* by architecture specific mechanism. Exposing this information to +* userspace allows it to take appropriate actions to handle an +* error on the device. The ioctl returns -ENOMSG if there are no pending +* PCI errors. +*/ + +struct vfio_device_feature_zpci_err { +__u32 feature_flags;/* Indicate future features */ +__u32 reserved1; +__u32 fh;/* function handle */ +__u32 fid;/* function id */ +__u32 ett :4 ;/* expected table type */ +__u32 mvn :12 ;/* MSI vector number */ +__u32 dmaas :8 ;/* DMA address space */ +__u32 reserved2 :6 ; +__u32 q :1 ;/* event qualifier */ include/uapi/linux/vfio.h struct vfio_device_feature_dma_buf { · line 1566
Quoted 10 lines
include/uapi/linux/vfio.h +10
-0+ __u32 rw : 1; /* read/write */ +__u64 faddr;/* failing address */ +__u32 reserved3; +__u16 reserved4; +__u16 pec;/* PCI event code */ +__u8 reserved5[28 ];/* Allow for future expansion */ +}; + +#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13 +There are currently at least 4 different patch series, including this one, that are vying for device feature allocations. This series spans PCI, s390, and vfio, and I'm not entirely sure which maintainer should take it. With Niklas' review on patch 4, should we ask Bjorn to take 1-3 through PCI, share a branch, and I could merge 4-7 through vfio? Thanks,
Quoted 1 line
Alex
If it helps I can break the series into PCI only and vfio only patches. Please let me know if there is anything I can help with to make the merge easier.
Thanks
Farhan
Alex Williamson
maintainerRe: [PATCH v17 5/7] vfio-pci/zdev: Add a device feature for error information
Quoted 155 lines · On Tue, 2 Jun 2026 14:38:56 -0700 Farhan Ali <[email protected]> wrote:
Quoted 145 lines · Alex Williamson
Quoted 142 lines · On Wed, 20 May 2026 10:11:11 -0700 Farhan Ali <[email protected]> wrote:
For zPCI devices, we have platform specific error information. The platform firmware provides this error information to the operating system in an architecture specific mechanism. To enable recovery from userspace for these devices, we want to expose this error information to userspace. Add a new device feature to expose this information.
Reviewed-by Matthew Rosato <[email protected]>Reviewed-by Niklas Schnelle <[email protected]>Signed-off-by Farhan Ali <[email protected]>--- arch/s390/include/asm/pci.h | 2 ++ arch/s390/pci/pci_event.c | 19 ++++++++++++++++ drivers/vfio/pci/vfio_pci_core.c | 2 ++ drivers/vfio/pci/vfio_pci_priv.h | 9 ++++++++ drivers/vfio/pci/vfio_pci_zdev.c | 39 ++++++++++++++++++++++++++++++++ include/uapi/linux/vfio.h | 30 ++++++++++++++++++++++++ 6 files changed, 101 insertions(+)arch/s390/include/asm/pci.h +2
-0@@ -364,6 +364,8 @@ int zpci_clear_error_state(struct zpci_dev *zdev);int zpci_reset_load_store_blocked (struct zpci_dev *zdev);void zpci_start_mediated_recovery (struct zpci_dev *zdev);void zpci_stop_mediated_recovery (struct zpci_dev *zdev); +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf);#ifdef CONFIG_NUMA arch/s390/pci/pci_event.c +19
-0@@ -75,6 +75,25 @@ static int zpci_store_pci_error(struct pci_dev *pdev,return 0 ; } +int zpci_get_pending_error (struct zpci_dev *zdev, +struct zpci_ccdf_err *ccdf) +{ +int head =0 ; + +guard (mutex)(&zdev->pending_errs_lock); + +if (!zdev->pending_errs.count) +return -ENOMSG ; + + head = zdev->pending_errs.head %ZPCI_ERR_PENDING_MAX ; +memcpy (ccdf, &zdev->pending_errs.err[head], +sizeof (struct zpci_ccdf_err )); + zdev->pending_errs.head++; + zdev->pending_errs.count--; +return 0 ; +} +EXPORT_SYMBOL_GPL (zpci_get_pending_error); +void zpci_start_mediated_recovery (struct zpci_dev *zdev) {guard (mutex)(&zdev->pending_errs_lock);drivers/vfio/pci/vfio_pci_core.c +2
-0@@ -1569,6 +1569,8 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,return vfio_pci_core_feature_token (vdev, flags, arg, argsz);case VFIO_DEVICE_FEATURE_DMA_BUF :return vfio_pci_core_feature_dma_buf (vdev, flags, arg, argsz); +case VFIO_DEVICE_FEATURE_ZPCI_ERROR : +return vfio_pci_zdev_feature_err (device, flags, arg, argsz);default :return -ENOTTY ; }drivers/vfio/pci/vfio_pci_priv.h +9
-0@@ -93,6 +93,8 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, struct vfio_info_cap *caps);int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev);void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev); +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz);#else static inline int vfio_pci_info_zdev_add_caps (struct vfio_pci_core_device *vdev,struct vfio_info_cap *caps)@@ -107,6 +109,13 @@ static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)static inline void vfio_pci_zdev_close_device (struct vfio_pci_core_device *vdev) {} + +static inline int vfio_pci_zdev_feature_err (struct vfio_device *device, +u32 flags,void __user *arg, +size_t argsz) +{ +return -ENOTTY ; +}#endif static inline bool vfio_pci_is_vga (struct pci_dev *pdev)drivers/vfio/pci/vfio_pci_zdev.c +33
-0@@ -141,6 +141,45 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,return ret; } +int vfio_pci_zdev_feature_err (struct vfio_device *device,u32 flags, +void __user *arg,size_t argsz) +{ +struct vfio_device_feature_zpci_err err = {}; +struct vfio_pci_core_device *vdev; +struct zpci_ccdf_err ccdf = {}; +struct zpci_dev *zdev; +int ret; + + vdev = container_of(device, struct vfio_pci_core_device, vdev); + zdev =to_zpci (vdev->pdev); +if (!zdev) +return -ENODEV ; + + ret =vfio_check_feature (flags, argsz,VFIO_DEVICE_FEATURE_GET , +sizeof (err)); +if (ret !=1 ) +return ret; + + ret =zpci_get_pending_error (zdev, &ccdf); +if (ret) +return ret; + + err.fh = ccdf.fh; + err.fid = ccdf.fid; + err.ett = ccdf.ett; + err.mvn = ccdf.mvn; + err.dmaas = ccdf.dmaas; + err.q = ccdf.q; + err.rw = ccdf.rw; + err.faddr = ccdf.faddr; + err.pec = ccdf.pec; +Quoted 8 lines
drivers/vfio/pci/vfio_pci_zdev.c int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, · line 181
Quoted 5 lines
drivers/vfio/pci/vfio_pci_zdev.c +5
-0+if (copy_to_user (arg, &err,sizeof (err))) +return -EFAULT ; + +return 0 ; +}There's a concern here that the error is dequeued but we can still fail resulting in a lost error. Is that a sufficiently unlikely scenario to ignore or should it at least be documented?
Quoted 4 lines
IMHO this scenario would be unlikely and could be ignored. I think to handle this we would need something like a
peek()API and only remove and update thepending_errsifcopy_to_usersucceeds. This would be adding more complexity for a relatively low possibility of failure.
Or just a dev_warn_ratelimited().
Quoted 49 lines
Quoted 49 lines
Quoted 32 lines
drivers/vfio/pci/vfio_pci_zdev.c +1
-0+int vfio_pci_zdev_open_device (struct vfio_pci_core_device *vdev) {struct zpci_dev *zdev =to_zpci (vdev->pdev);include/uapi/linux/vfio.h +20
-0@@ -1534,6 +1534,36 @@ struct vfio_device_feature_dma_buf {*/ #define VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 12 +/** +* VFIO_DEVICE_FEATURE_ZPCI_ERROR feature provides PCI error information to +* userspace for vfio-pci devices on s390. On s390, PCI error recovery +* involves platform firmware and notification to operating systems is done +* by architecture specific mechanism. Exposing this information to +* userspace allows it to take appropriate actions to handle an +* error on the device. The ioctl returns -ENOMSG if there are no pending +* PCI errors. +*/ + +struct vfio_device_feature_zpci_err { +__u32 feature_flags;/* Indicate future features */ +__u32 reserved1; +__u32 fh;/* function handle */ +__u32 fid;/* function id */ +__u32 ett :4 ;/* expected table type */ +__u32 mvn :12 ;/* MSI vector number */ +__u32 dmaas :8 ;/* DMA address space */ +__u32 reserved2 :6 ; +__u32 q :1 ;/* event qualifier */ include/uapi/linux/vfio.h struct vfio_device_feature_dma_buf { · line 1566
Quoted 10 lines
include/uapi/linux/vfio.h +10
-0+ __u32 rw : 1; /* read/write */ +__u64 faddr;/* failing address */ +__u32 reserved3; +__u16 reserved4; +__u16 pec;/* PCI event code */ +__u8 reserved5[28 ];/* Allow for future expansion */ +}; + +#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13 +There are currently at least 4 different patch series, including this one, that are vying for device feature allocations. This series spans PCI, s390, and vfio, and I'm not entirely sure which maintainer should take it. With Niklas' review on patch 4, should we ask Bjorn to take 1-3 through PCI, share a branch, and I could merge 4-7 through vfio? Thanks,
Quoted 5 lines
Quoted 1 line
Alex
If it helps I can break the series into PCI only and vfio only patches. Please let me know if there is anything I can help with to make the merge easier.
Let's do that. Thanks,
Alex