public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] vfio-pci/zdev: Improved zPCI Function Measurement Support
@ 2026-05-01 19:25 Omar Elghoul
  2026-05-01 19:25 ` [PATCH v1 1/3] s390/pci: Preserve FMB state in device re-enablement Omar Elghoul
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Omar Elghoul @ 2026-05-01 19:25 UTC (permalink / raw)
  To: linux-s390, linux-kernel, kvm
  Cc: oelghoul, hca, gor, agordeev, borntraeger, svens, schnelle,
	mjrosato, alifm, farman, gbayer, alex

Hi,

This patch series improves support for function measurement for zPCI
passthrough devices on s390x.

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 (3):
  s390/pci: Preserve FMB state in device re-enablement
  vfio-pci/zdev: Add VFIO FMB device feature
  s390/pci: Fence FMB enable/disable via sysfs for passthrough devices

 arch/s390/include/asm/pci.h      |  1 +
 arch/s390/pci/pci.c              | 71 +++++++++++++++++++++++------
 arch/s390/pci/pci_debug.c        |  3 ++
 drivers/vfio/pci/vfio_pci_core.c |  2 +
 drivers/vfio/pci/vfio_pci_priv.h |  9 ++++
 drivers/vfio/pci/vfio_pci_zdev.c | 77 ++++++++++++++++++++++++++++++++
 include/uapi/linux/vfio.h        | 43 ++++++++++++++++++
 7 files changed, 193 insertions(+), 13 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-03  1:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01 19:25 [PATCH v1 0/3] vfio-pci/zdev: Improved zPCI Function Measurement Support Omar Elghoul
2026-05-01 19:25 ` [PATCH v1 1/3] s390/pci: Preserve FMB state in device re-enablement Omar Elghoul
2026-05-01 19:25 ` [PATCH v1 2/3] vfio-pci/zdev: Add VFIO FMB device feature Omar Elghoul
2026-05-01 19:25 ` [PATCH v1 3/3] s390/pci: Fence FMB enable/disable via sysfs for passthrough devices Omar Elghoul
2026-05-03  1:11   ` kernel test robot
2026-05-01 20:17 ` [PATCH v1 0/3] vfio-pci/zdev: Improved zPCI Function Measurement Support Omar Elghoul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox