History

Merge branches 'fixes', 'arm/smmu/updates', 'intel/vt-d', 'amd/amd-vi' and 'core' into next

Joerg Roedel committed 9 months ago

Commit ad095635 parents 02f9d76 a45dd34 c3b1ede 9e249c4 b48ca9249 files · +1996 −498Browse files

Showing the changes to include/uapi (2 of 49 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/iommufd.h +39 −0
  2. include/uapi/linux/vfio.h +4 −0
include/uapi/linux/iommufd.h+39−0
@@ -465,16 +465,27 @@ struct iommu_hwpt_arm_smmuv3 { · 464 unmodified lines
465465 __aligned_le64 ste[2];
466466 };
467467
468+/**
469+ * struct iommu_hwpt_amd_guest - AMD IOMMU guest I/O page table data
470+ * (IOMMU_HWPT_DATA_AMD_GUEST)
471+ * @dte: Guest Device Table Entry (DTE)
472+ */
473+struct iommu_hwpt_amd_guest {
474+ __aligned_u64 dte[4];
475+};
476+
468477 /**
469478 * enum iommu_hwpt_data_type - IOMMU HWPT Data Type
470479 * @IOMMU_HWPT_DATA_NONE: no data
471480 * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table
472481 * @IOMMU_HWPT_DATA_ARM_SMMUV3: ARM SMMUv3 Context Descriptor Table
482+ * @IOMMU_HWPT_DATA_AMD_GUEST: AMD IOMMU guest page table
473483 */
474484 enum iommu_hwpt_data_type {
475485 IOMMU_HWPT_DATA_NONE = 0,
476486 IOMMU_HWPT_DATA_VTD_S1 = 1,
477487 IOMMU_HWPT_DATA_ARM_SMMUV3 = 2,
488+ IOMMU_HWPT_DATA_AMD_GUEST = 3,
478489 };
479490
480491 /**
@@ -623,6 +634,32 @@ struct iommu_hw_info_tegra241_cmdqv { · 142 unmodified lines
623634 __u8 __reserved;
624635 };
625636
637+/**
638+ * struct iommu_hw_info_amd - AMD IOMMU device info
639+ *
640+ * @efr : Value of AMD IOMMU Extended Feature Register (EFR)
641+ * @efr2: Value of AMD IOMMU Extended Feature 2 Register (EFR2)
642+ *
643+ * Please See description of these registers in the following sections of
644+ * the AMD I/O Virtualization Technology (IOMMU) Specification.
645+ * (https://docs.amd.com/v/u/en-US/48882_3.10_PUB)
646+ *
647+ * - MMIO Offset 0030h IOMMU Extended Feature Register
648+ * - MMIO Offset 01A0h IOMMU Extended Feature 2 Register
649+ *
650+ * Note: The EFR and EFR2 are raw values reported by hardware.
651+ * VMM is responsible to determine the appropriate flags to be exposed to
652+ * the VM since cetertain features are not currently supported by the kernel
653+ * for HW-vIOMMU.
654+ *
655+ * Current VMM-allowed list of feature flags are:
656+ * - EFR[GTSup, GASup, GioSup, PPRSup, EPHSup, GATS, GLX, PASmax]
657+ */
658+struct iommu_hw_info_amd {
659+ __aligned_u64 efr;
660+ __aligned_u64 efr2;
661+};
662+
626663 /**
627664 * enum iommu_hw_info_type - IOMMU Hardware Info Types
628665 * @IOMMU_HW_INFO_TYPE_NONE: Output by the drivers that do not report hardware
@@ -632,6 +669,7 @@ struct iommu_hw_info_tegra241_cmdqv { · 3 unmodified lines
632669 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type
633670 * @IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV: NVIDIA Tegra241 CMDQV (extension for ARM
634671 * SMMUv3) info type
672+ * @IOMMU_HW_INFO_TYPE_AMD: AMD IOMMU info type
635673 */
636674 enum iommu_hw_info_type {
637675 IOMMU_HW_INFO_TYPE_NONE = 0,
@@ -639,6 +677,7 @@ enum iommu_hw_info_type { · 1 unmodified line
639677 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,
640678 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,
641679 IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV = 3,
680+ IOMMU_HW_INFO_TYPE_AMD = 4,
642681 };
643682
644683 /**
include/uapi/linux/vfio.h+4−0
@@ -964,6 +964,10 @@ struct vfio_device_bind_iommufd { · 963 unmodified lines
964964 * hwpt corresponding to the given pt_id.
965965 *
966966 * Return: 0 on success, -errno on failure.
967+ *
968+ * When a device is resetting, -EBUSY will be returned to reject any concurrent
969+ * attachment to the resetting device itself or any sibling device in the IOMMU
970+ * group having the resetting device.
967971 */
968972 struct vfio_device_attach_iommufd_pt {
969973 __u32 argsz;