[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813154238.78794b31.alex.williamson@redhat.com>
Date: Wed, 13 Aug 2025 15:42:38 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Farhan Ali <alifm@...ux.ibm.com>
Cc: linux-s390@...r.kernel.org, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, schnelle@...ux.ibm.com,
mjrosato@...ux.ibm.com
Subject: Re: [PATCH v1 4/6] vfio-pci/zdev: Setup a zpci memory region for
error information
On Wed, 13 Aug 2025 14:25:59 -0700
Farhan Ali <alifm@...ux.ibm.com> wrote:
> On 8/13/2025 1:30 PM, Alex Williamson wrote:
> > On Wed, 13 Aug 2025 10:08:18 -0700
> > Farhan Ali <alifm@...ux.ibm.com> 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?
Yes, and there's a probe capability built-in to determine support.
> 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?
Given our current segmenting of the vfio device fd, we're using 40-bits
of address space for a 6-byte structure. We're returning structured
data that has no requirement to be read at arbitrary offsets and
lengths. For example, does this series really even handle a short
read? We adjust counters for any read, it's more prone to those sorts
of errors.
Maybe if you actually wanted to allow the user to mmap the error array
buffer and move the head as they read data while the kernel
asynchronously fills from the tail, it might make sense to use a
region, but as used here I don't think it's the right interface.
Thanks,
Alex
Powered by blists - more mailing lists