Re: [PATCH v1 4/6] vfio-pci/zdev: Setup a zpci memory region for error information

From: Farhan Ali
Date: Wed Aug 13 2025 - 17:26:24 EST



On 8/13/2025 1:30 PM, Alex Williamson wrote:
On Wed, 13 Aug 2025 10:08:18 -0700
Farhan Ali <alifm@xxxxxxxxxxxxx> wrote:
diff --git a/include/uapi/linux/vfio_zdev.h b/include/uapi/linux/vfio_zdev.h
index 77f2aff1f27e..bcd06f334a42 100644
--- a/include/uapi/linux/vfio_zdev.h
+++ b/include/uapi/linux/vfio_zdev.h
@@ -82,4 +82,9 @@ struct vfio_device_info_cap_zpci_pfip {
__u8 pfip[];
};
+struct vfio_device_zpci_err_region {
+ __u16 pec;
+ int pending_errors;
+};
+
#endif
If this is uapi it would hopefully include some description, but if
this is the extent of what can be read from the device specific region,
why not just return it via a DEVICE_FEATURE ioctl? Thanks,

Alex

Yes, will add more details about the uapi. My thinking was based on how we expose some other vfio device information on s390x, such as SCHIB for vfio-ccw device.

I didn't think about the DEVICE_FEATURE ioctl. But looking into it, it looks like we would have to define a device feature (for eg: VFIO_DEVICE_FEATURE_ZPCI_ERROR), and expose this information via GET_FEATURE? If the preference is to use the DEVICE_FEATURE ioctl I can try that. Curious, any specific reason you prefer the DEVICE_FEATURE ioctl to the memory region?

Thanks
Farhan