Skip to content

Commit 77b8aeb

Browse files
committed
vfio/pci: Revert nvlink removal uAPI breakage
Revert the uAPI changes from the below commit with notice that these regions and capabilities are no longer provided. Fixes: b392a19 ("vfio/pci: remove vfio_pci_nvlink2") Reported-by: Greg Kurz <[email protected]> Signed-off-by: Alex Williamson <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Reviewed-by: Greg Kurz <[email protected]> Tested-by: Greg Kurz <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Message-Id: <162014341432.3807030.11054087109120670135.stgit@omen>
1 parent 698f99e commit 77b8aeb

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

include/uapi/linux/vfio.h

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,21 @@ struct vfio_region_info_cap_type {
333333
#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
334334

335335
/* 10de vendor PCI sub-types */
336-
/* subtype 1 was VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM, don't use */
336+
/*
337+
* NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space.
338+
*
339+
* Deprecated, region no longer provided
340+
*/
341+
#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1)
337342

338343
/* 1014 vendor PCI sub-types */
339-
/* subtype 1 was VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD, don't use */
344+
/*
345+
* IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU
346+
* to do TLB invalidation on a GPU.
347+
*
348+
* Deprecated, region no longer provided
349+
*/
350+
#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1)
340351

341352
/* sub-types for VFIO_REGION_TYPE_GFX */
342353
#define VFIO_REGION_SUBTYPE_GFX_EDID (1)
@@ -630,9 +641,36 @@ struct vfio_device_migration_info {
630641
*/
631642
#define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3
632643

633-
/* subtype 4 was VFIO_REGION_INFO_CAP_NVLINK2_SSATGT, don't use */
644+
/*
645+
* Capability with compressed real address (aka SSA - small system address)
646+
* where GPU RAM is mapped on a system bus. Used by a GPU for DMA routing
647+
* and by the userspace to associate a NVLink bridge with a GPU.
648+
*
649+
* Deprecated, capability no longer provided
650+
*/
651+
#define VFIO_REGION_INFO_CAP_NVLINK2_SSATGT 4
652+
653+
struct vfio_region_info_cap_nvlink2_ssatgt {
654+
struct vfio_info_cap_header header;
655+
__u64 tgt;
656+
};
634657

635-
/* subtype 5 was VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD, don't use */
658+
/*
659+
* Capability with an NVLink link speed. The value is read by
660+
* the NVlink2 bridge driver from the bridge's "ibm,nvlink-speed"
661+
* property in the device tree. The value is fixed in the hardware
662+
* and failing to provide the correct value results in the link
663+
* not working with no indication from the driver why.
664+
*
665+
* Deprecated, capability no longer provided
666+
*/
667+
#define VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD 5
668+
669+
struct vfio_region_info_cap_nvlink2_lnkspd {
670+
struct vfio_info_cap_header header;
671+
__u32 link_speed;
672+
__u32 __pad;
673+
};
636674

637675
/**
638676
* VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,

0 commit comments

Comments
 (0)