162306a36Sopenharmony_ciWhat: /sys/kernel/iommu_groups/ 262306a36Sopenharmony_ciDate: May 2012 362306a36Sopenharmony_ciKernelVersion: v3.5 462306a36Sopenharmony_ciContact: Alex Williamson <alex.williamson@redhat.com> 562306a36Sopenharmony_ciDescription: /sys/kernel/iommu_groups/ contains a number of sub- 662306a36Sopenharmony_ci directories, each representing an IOMMU group. The 762306a36Sopenharmony_ci name of the sub-directory matches the iommu_group_id() 862306a36Sopenharmony_ci for the group, which is an integer value. Within each 962306a36Sopenharmony_ci subdirectory is another directory named "devices" with 1062306a36Sopenharmony_ci links to the sysfs devices contained in this group. 1162306a36Sopenharmony_ci The group directory also optionally contains a "name" 1262306a36Sopenharmony_ci file if the IOMMU driver has chosen to register a more 1362306a36Sopenharmony_ci common name for the group. 1462306a36Sopenharmony_ciUsers: 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ciWhat: /sys/kernel/iommu_groups/reserved_regions 1762306a36Sopenharmony_ciDate: January 2017 1862306a36Sopenharmony_ciKernelVersion: v4.11 1962306a36Sopenharmony_ciContact: Eric Auger <eric.auger@redhat.com> 2062306a36Sopenharmony_ciDescription: /sys/kernel/iommu_groups/reserved_regions list IOVA 2162306a36Sopenharmony_ci regions that are reserved. Not necessarily all 2262306a36Sopenharmony_ci reserved regions are listed. This is typically used to 2362306a36Sopenharmony_ci output direct-mapped, MSI, non mappable regions. Each 2462306a36Sopenharmony_ci region is described on a single line: the 1st field is 2562306a36Sopenharmony_ci the base IOVA, the second is the end IOVA and the third 2662306a36Sopenharmony_ci field describes the type of the region. 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci Since kernel 5.3, in case an RMRR is used only by graphics or 2962306a36Sopenharmony_ci USB devices it is now exposed as "direct-relaxable" instead 3062306a36Sopenharmony_ci of "direct". In device assignment use case, for instance, 3162306a36Sopenharmony_ci those RMRR are considered to be relaxable and safe. 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciWhat: /sys/kernel/iommu_groups/<grp_id>/type 3462306a36Sopenharmony_ciDate: November 2020 3562306a36Sopenharmony_ciKernelVersion: v5.11 3662306a36Sopenharmony_ciContact: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> 3762306a36Sopenharmony_ciDescription: /sys/kernel/iommu_groups/<grp_id>/type shows the type of default 3862306a36Sopenharmony_ci domain in use by iommu for this group. See include/linux/iommu.h 3962306a36Sopenharmony_ci for possible read values. A privileged user could request kernel to 4062306a36Sopenharmony_ci change the group type by writing to this file. Valid write values: 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci ======== ====================================================== 4362306a36Sopenharmony_ci DMA All the DMA transactions from the device in this group 4462306a36Sopenharmony_ci are translated by the iommu. 4562306a36Sopenharmony_ci DMA-FQ As above, but using batched invalidation to lazily 4662306a36Sopenharmony_ci remove translations after use. This may offer reduced 4762306a36Sopenharmony_ci overhead at the cost of reduced memory protection. 4862306a36Sopenharmony_ci identity All the DMA transactions from the device in this group 4962306a36Sopenharmony_ci are not translated by the iommu. Maximum performance 5062306a36Sopenharmony_ci but zero protection. 5162306a36Sopenharmony_ci auto Change to the type the device was booted with. 5262306a36Sopenharmony_ci ======== ====================================================== 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci The default domain type of a group may be modified only when 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci - The device in the group is not bound to any device driver. 5762306a36Sopenharmony_ci So, the users must unbind the appropriate driver before 5862306a36Sopenharmony_ci changing the default domain type. 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci Unbinding a device driver will take away the driver's control 6162306a36Sopenharmony_ci over the device and if done on devices that host root file 6262306a36Sopenharmony_ci system could lead to catastrophic effects (the users might 6362306a36Sopenharmony_ci need to reboot the machine to get it to normal state). So, it's 6462306a36Sopenharmony_ci expected that the users understand what they're doing. 65