Hi,

On 2020/2/17 5:57, Sai Praneeth Prakhya wrote:
The default domain type of an iommu group can be changed using file
"/sys/kernel/iommu_groups/<grp_id>/type". Hence, document it's usage and
more importantly spell out it's limitations.

Cc: Christoph Hellwig <h...@lst.de>
Cc: Joerg Roedel <j...@8bytes.org>
Cc: Ashok Raj <ashok....@intel.com>
Cc: Will Deacon <will.dea...@arm.com>
Cc: Lu Baolu <baolu...@linux.intel.com>
Cc: Sohil Mehta <sohil.me...@intel.com>
Cc: Robin Murphy <robin.mur...@arm.com>
Cc: Jacob Pan <jacob.jun....@linux.intel.com>
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com>
---
  .../ABI/testing/sysfs-kernel-iommu_groups          | 29 ++++++++++++++++++++++
  1 file changed, 29 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-kernel-iommu_groups 
b/Documentation/ABI/testing/sysfs-kernel-iommu_groups
index 017f5bc3920c..808a9507b281 100644
--- a/Documentation/ABI/testing/sysfs-kernel-iommu_groups
+++ b/Documentation/ABI/testing/sysfs-kernel-iommu_groups
@@ -33,3 +33,32 @@ Description:    In case an RMRR is used only by graphics or 
USB devices
                it is now exposed as "direct-relaxable" instead of "direct".
                In device assignment use case, for instance, those RMRR
                are considered to be relaxable and safe.
+
+What:          /sys/kernel/iommu_groups/<grp_id>/type
+Date:          February 2020
+KernelVersion: v5.6
+Contact:       Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com>
+Description:   Lets the user know the type of default domain in use by iommu
+               for this group. A privileged user could request kernel to change

Let the users know the default domain type of the IOMMU group by
reading this file. A privileged user could request to change it by
writing to this file.

+               the group type by writing to this file. Presently, only three
+               types are supported
+               1. DMA: All the DMA transactions from the devices in this group
+                       are translated by the iommu.
+               2. identity: All the DMA transactions from the devices in this
+                            group are *not* translated by the iommu.
+               3. auto: Kernel decides one among DMA/identity mode and hence
+                        when the user reads the file he would never see "auto".

Just out of curiosity, when could a user reads "auto" from this file?

+                        This is just a write only value.
+               Note:
+               -----
+               A group type could be modified only when *all* the devices in

group's default domain type (not group type).

+               the group are not binded to any device driver. So, the user has

bound

+               to first unbind the appropriate drivers and then change the
+               default domain type.
+               Caution:
+               --------
+               Unbinding a device driver will take away the drivers control
+               over the device and if done on devices that host root file
+               system could lead to catastrophic effects (the user might
+               need to reboot the machine to get it to normal state). So, it's
+               expected that the user understands what he is doing.


Best regards,
baolu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to