Skip to content

Commit a2de4bb

Browse files
committed
Merge tag 'vfio-v5.13-rc1pt2' of git://github.com/awilliam/linux-vfio
Pull more VFIO updates from Alex Williamson: "A second small set of commits for this merge window, primarily to unbreak some deletions from our uAPI header. - Additional mdev sample driver cleanup (Dan Carpenter) - Doc fix (Alyssa Ross) - Unbreak uAPI from NVLink2 support removal (Alex Williamson)" * tag 'vfio-v5.13-rc1pt2' of git://github.com/awilliam/linux-vfio: docs: vfio: fix typo vfio/pci: Revert nvlink removal uAPI breakage vfio/mdev: remove unnecessary NULL check in mbochs_create()
2 parents 3818216 + cc35518 commit a2de4bb

File tree

4 files changed

+44
-9
lines changed

4 files changed

+44
-9
lines changed

Documentation/driver-api/vfio.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VFIO - "Virtual Function I/O" [1]_
33
==================================
44

5-
Many modern system now provide DMA and interrupt remapping facilities
5+
Many modern systems now provide DMA and interrupt remapping facilities
66
to help ensure I/O devices behave within the boundaries they've been
77
allotted. This includes x86 hardware with AMD-Vi and Intel VT-d,
88
POWER systems with Partitionable Endpoints (PEs) and embedded PowerPC

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,

samples/vfio-mdev/mbochs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,6 @@ static int mbochs_create(struct mdev_device *mdev)
513513
struct device *dev = mdev_dev(mdev);
514514
struct mdev_state *mdev_state;
515515

516-
if (!type)
517-
type = &mbochs_types[0];
518516
if (type->mbytes + mbochs_used_mbytes > max_mbytes)
519517
return -ENOMEM;
520518

samples/vfio-mdev/mdpy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,7 @@ static ssize_t description_show(struct mdev_type *mtype,
667667
&mdpy_types[mtype_get_type_group_id(mtype)];
668668

669669
return sprintf(buf, "virtual display, %dx%d framebuffer\n",
670-
type ? type->width : 0,
671-
type ? type->height : 0);
670+
type->width, type->height);
672671
}
673672
static MDEV_TYPE_ATTR_RO(description);
674673

0 commit comments

Comments
 (0)