Re: [PATCH v13 0/5] vfio-pci/zdev: Improved zPCI Function Measurement Support

From: Alexander Gordeev

Date: Thu Nov 19 2026 - 11:29:32 EST


On Wed, Nov 11, 2026 at 11:27:53AM -0500, Omar Elghoul wrote:
> This patch series improves support for function measurement for zPCI
> passthrough devices on s390.
...
> Motivation
> ==========
> The firmware on s390x machines allows for tracking a variety of statistics
> relating to zPCI devices in a function measurement block (FMB). However,
> the kernel currently lacks a structured mechanism of sharing this
> information with userspace, beyond /sys/kernel/debug/pci/ID/statistics.
> This can lead to shortcomings when running a guest on KVM with PCI
> passthrough devices, as QEMU is unable to provide an accurate FMB snapshot
> to the guest.
>
> Proposal
> ========
> We propose adding a new VFIO device feature to zPCI passthrough devices,
> allowing userspace programs to read the latest FMB snapshot as it is
> written by the firmware. We ensure that function measurement enablement is
> preserved across device resets on the host. Furthermore, we guard against
> host tampering with the FMB via sysfs when the zPCI device is in
> passthrough to protect the VM's state.
>
> I'd appreciate some feedback on these patches.
>
> Thanks in advance.
>
> Omar Elghoul (5):
> s390/pci: Hold fmb_lock when enabling or disabling PCI devices
> s390/pci: Improve function measurement state management
> s390/pci: Improve FMB memory management
> s390/pci: Fence FMB enable/disable via debugfs for passthrough devices
> vfio-pci/zdev: Add VFIO FMB device features
>
> arch/s390/include/asm/pci.h | 8 +-
> arch/s390/pci/pci.c | 123 +++++++++++++++++++++++--------
> arch/s390/pci/pci_debug.c | 15 +++-
> drivers/vfio/pci/vfio_pci_core.c | 4 +
> drivers/vfio/pci/vfio_pci_priv.h | 18 +++++
> drivers/vfio/pci/vfio_pci_zdev.c | 64 ++++++++++++++++
> include/uapi/linux/vfio.h | 30 ++++++++
> 7 files changed, 226 insertions(+), 36 deletions(-)

Applied and put on a branch, as agreed:

git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git zpci-meas-enh

Thanks!