e6c5d726 parents e3fb13b 78becab db2cb96 92c8026 eee413e b09d6e45 files · +583 −71Browse filesShowing the changes to include/uapi/linux (1 of 5 files). Show all
Unified · Split
| @@ -295,15 +295,38 @@ struct vfio_region_info_cap_type { · 294 unmodified lines | ||
| 295 | 295 | __u32 subtype; /* type specific */ |
| 296 | 296 | }; |
| 297 | 297 | |
| 298 | +/* | |
| 299 | + * List of region types, global per bus driver. | |
| 300 | + * If you introduce a new type, please add it here. | |
| 301 | + */ | |
| 302 | + | |
| 303 | +/* PCI region type containing a PCI vendor part */ | |
| 298 | 304 | #define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31) |
| 299 | 305 | #define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff) |
| 306 | +#define VFIO_REGION_TYPE_GFX (1) | |
| 307 | +#define VFIO_REGION_TYPE_CCW (2) | |
| 308 | + | |
| 309 | +/* sub-types for VFIO_REGION_TYPE_PCI_* */ | |
| 300 | 310 | |
| 301 | −/* 8086 Vendor sub-types */ | |
| 311 | +/* 8086 vendor PCI sub-types */ | |
| 302 | 312 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1) |
| 303 | 313 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2) |
| 304 | 314 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3) |
| 305 | 315 | |
| 306 | −#define VFIO_REGION_TYPE_GFX (1) | |
| 316 | +/* 10de vendor PCI sub-types */ | |
| 317 | +/* | |
| 318 | + * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space. | |
| 319 | + */ | |
| 320 | +#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1) | |
| 321 | + | |
| 322 | +/* 1014 vendor PCI sub-types */ | |
| 323 | +/* | |
| 324 | + * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU | |
| 325 | + * to do TLB invalidation on a GPU. | |
| 326 | + */ | |
| 327 | +#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1) | |
| 328 | + | |
| 329 | +/* sub-types for VFIO_REGION_TYPE_GFX */ | |
| 307 | 330 | #define VFIO_REGION_SUBTYPE_GFX_EDID (1) |
| 308 | 331 | |
| 309 | 332 | /** |
| @@ -353,25 +376,9 @@ struct vfio_region_gfx_edid { · 43 unmodified lines | ||
| 353 | 376 | #define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2 |
| 354 | 377 | }; |
| 355 | 378 | |
| 356 | −#define VFIO_REGION_TYPE_CCW (2) | |
| 357 | −/* ccw sub-types */ | |
| 379 | +/* sub-types for VFIO_REGION_TYPE_CCW */ | |
| 358 | 380 | #define VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD (1) |
| 359 | 381 | |
| 360 | −/* | |
| 361 | − * 10de vendor sub-type | |
| 362 | − * | |
| 363 | − * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space. | |
| 364 | − */ | |
| 365 | −#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1) | |
| 366 | − | |
| 367 | −/* | |
| 368 | − * 1014 vendor sub-type | |
| 369 | − * | |
| 370 | − * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU | |
| 371 | − * to do TLB invalidation on a GPU. | |
| 372 | − */ | |
| 373 | −#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1) | |
| 374 | − | |
| 375 | 382 | /* |
| 376 | 383 | * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped |
| 377 | 384 | * which allows direct access to non-MSIX registers which happened to be within |
| @@ -714,7 +721,31 @@ struct vfio_iommu_type1_info { · 336 unmodified lines | ||
| 714 | 721 | __u32 argsz; |
| 715 | 722 | __u32 flags; |
| 716 | 723 | #define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */ |
| 717 | − __u64 iova_pgsizes; /* Bitmap of supported page sizes */ | |
| 724 | +#define VFIO_IOMMU_INFO_CAPS (1 << 1) /* Info supports caps */ | |
| 725 | + __u64 iova_pgsizes; /* Bitmap of supported page sizes */ | |
| 726 | + __u32 cap_offset; /* Offset within info struct of first cap */ | |
| 727 | +}; | |
| 728 | + | |
| 729 | +/* | |
| 730 | + * The IOVA capability allows to report the valid IOVA range(s) | |
| 731 | + * excluding any non-relaxable reserved regions exposed by | |
| 732 | + * devices attached to the container. Any DMA map attempt | |
| 733 | + * outside the valid iova range will return error. | |
| 734 | + * | |
| 735 | + * The structures below define version 1 of this capability. | |
| 736 | + */ | |
| 737 | +#define VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE 1 | |
| 738 | + | |
| 739 | +struct vfio_iova_range { | |
| 740 | + __u64 start; | |
| 741 | + __u64 end; | |
| 742 | +}; | |
| 743 | + | |
| 744 | +struct vfio_iommu_type1_info_cap_iova_range { | |
| 745 | + struct vfio_info_cap_header header; | |
| 746 | + __u32 nr_iovas; | |
| 747 | + __u32 reserved; | |
| 748 | + struct vfio_iova_range iova_ranges[]; | |
| 718 | 749 | }; |
| 719 | 750 | |
| 720 | 751 | #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) |