summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-20 16:57:59 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-20 16:57:59 -0700
commita625b2a387628df94e385faf5c81bf252f304ed9 (patch)
treee3be1a5a3d57d45aea64e977827d2fd9c6adfd7a /include
parent77ae27fd98f3b548797c9f22c10ab5cf1c4ada53 (diff)
parent4e3c1fc8abcb8eff062150b4340fa4569696d645 (diff)
Merge tag 'vfio-v7.3-rc1' of https://github.com/awilliam/linux-vfio
Pull VFIO updates from Alex Williamson: - Add nv_falcon vfio selftest driver. The Falcon is a general-purpose microcontroller embedded within NVIDIA GPUs, presenting a relatively simple DMA programming interface. This adds another selftest target for vfio-pci with real DMA transfers (Rubin Du, Alex Williamson) - Add allocation assertion helpers to vfio selftests and use them to avoid variable length arrays and the compiler errors they generate (Alex Mastro) - Fix use-after-free hazard where an init path error in MSI support leaves a stray pointer that can later be reused or double-freed (Xiang Mei) - Fix previous refactor of PCI BAR mappings to honor non_mappable_bars flag, which otherwise generates a warning when trying to pci_iomap() a 256TiB BAR on ISM devices on s390 (Farhan Ali) - Add igb vfio selftest driver. Like nv_falcon, this provides another target for DMA testing with vfio selftests, but importantly this driver supports both physical 82576 NICs and the emulation model in QEMU. This therefore enables a vfio selftest vector with no physical hardware requirements (Josh Hilke, Alex Williamson) - Mark selftest fixture objects __maybe_unused to accommodate builds with clang -Wunused-but-set-global (David Matlack) - Add error recovery for vfio-pci devices on s390x. This expands devices which expose the existing error eventfd and introduces a device feature for reporting firmware defined error state information to the user, allowing recovery through hypervisor channels (Farhan Ali) * tag 'vfio-v7.3-rc1' of https://github.com/awilliam/linux-vfio: vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX vfio-pci/zdev: Add a device feature for error information s390/pci: Store PCI error information for passthrough devices PCI/MSI: Enable memory decoding before restoring MSI-X messages PCI: Fail FLR when config space is inaccessible PCI: Avoid saving config space state if inaccessible PCI: Allow per function PCI slots to fix slot reset on s390 PCI: Introduce PCI_SLOT_PLACEHOLDER constant for slot_nr placeholder value selftests: harness: Mark test fixture objects __maybe_unused vfio: selftests: Retry on EAGAIN during device reset vfio: selftests: igb: Add driver for Intel 82576 device vfio: selftests: Add helpers to re-enable interrupts vfio/pci: Avoid mapping BARs for devices with non-mappable BARs vfio/pci: clear vdev->msi_perm after freeing it on init failure vfio: selftests: Avoid VLAs vfio: selftests: Add allocation assert helpers vfio: selftests: Add NVIDIA Falcon driver for DMA testing vfio: selftests: Allow drivers without send_msi() support vfio: selftests: Add generic PCI command register helpers vfio: selftests: Add memcpy chunking to vfio_pci_driver_memcpy()
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci.h8
-rw-r--r--include/uapi/linux/vfio.h21
-rw-r--r--include/uapi/linux/vfio_zdev.h2
3 files changed, 29 insertions, 2 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3d2c1ac645ff..c956bbf18ecc 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -79,14 +79,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 0xffff
/* 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;
};
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 5de618a3a5ee..e41437fa17ad 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -1534,6 +1534,27 @@ 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.
+ *
+ * Userspace provides an opaque buffer of fixed length, and the kernel
+ * fills it with the zpci_ccdf_err data structure. The length of
+ * zpci_ccdf_err is provided to userspace via the
+ * VFIO_DEVICE_INFO_CAP_ZPCI_BASE capability.
+ *
+ * The ioctl returns -ENOMSG if there are no pending PCI errors.
+ */
+struct vfio_device_feature_zpci_err {
+ __aligned_u64 data;
+};
+
+#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13
+
/* -------- API for Type1 VFIO IOMMU -------- */
/**
diff --git a/include/uapi/linux/vfio_zdev.h b/include/uapi/linux/vfio_zdev.h
index 77f2aff1f27e..d6c1175c884e 100644
--- a/include/uapi/linux/vfio_zdev.h
+++ b/include/uapi/linux/vfio_zdev.h
@@ -32,6 +32,8 @@ struct vfio_device_info_cap_zpci_base {
/* End of version 1 */
__u32 fh; /* PCI function handle */
/* End of version 2 */
+ __u32 ccdf_err_length; /* PCI CCDF length */
+ /* End of version 3 */
};
/**