1d72e31c9SAlex WilliamsonWhat:		/sys/kernel/iommu_groups/
2d72e31c9SAlex WilliamsonDate:		May 2012
3d72e31c9SAlex WilliamsonKernelVersion:	v3.5
4d72e31c9SAlex WilliamsonContact:	Alex Williamson <alex.williamson@redhat.com>
5d72e31c9SAlex WilliamsonDescription:	/sys/kernel/iommu_groups/ contains a number of sub-
6d72e31c9SAlex Williamson		directories, each representing an IOMMU group.  The
7d72e31c9SAlex Williamson		name of the sub-directory matches the iommu_group_id()
8d72e31c9SAlex Williamson		for the group, which is an integer value.  Within each
9d72e31c9SAlex Williamson		subdirectory is another directory named "devices" with
10d72e31c9SAlex Williamson		links to the sysfs devices contained in this group.
11d72e31c9SAlex Williamson		The group directory also optionally contains a "name"
12d72e31c9SAlex Williamson		file if the IOMMU driver has chosen to register a more
13d72e31c9SAlex Williamson		common name for the group.
14d72e31c9SAlex WilliamsonUsers:
15bc7d12b9SEric Auger
16bc7d12b9SEric AugerWhat:		/sys/kernel/iommu_groups/reserved_regions
17bc7d12b9SEric AugerDate: 		January 2017
18bc7d12b9SEric AugerKernelVersion:  v4.11
19bc7d12b9SEric AugerContact: 	Eric Auger <eric.auger@redhat.com>
20bc7d12b9SEric AugerDescription:    /sys/kernel/iommu_groups/reserved_regions list IOVA
21bc7d12b9SEric Auger		regions that are reserved. Not necessarily all
22bc7d12b9SEric Auger		reserved regions are listed. This is typically used to
23bc7d12b9SEric Auger		output direct-mapped, MSI, non mappable regions. Each
24bc7d12b9SEric Auger		region is described on a single line: the 1st field is
25bc7d12b9SEric Auger		the base IOVA, the second is the end IOVA and the third
26bc7d12b9SEric Auger		field describes the type of the region.
27adfd3738SEric Auger
285286bd25SMauro Carvalho Chehab		Since kernel 5.3, in case an RMRR is used only by graphics or
295286bd25SMauro Carvalho Chehab		USB devices it is now exposed as "direct-relaxable" instead
305286bd25SMauro Carvalho Chehab		of "direct". In device assignment use case, for instance,
315286bd25SMauro Carvalho Chehab		those RMRR are considered to be relaxable and safe.
3263a81674SSai Praneeth Prakhya
3363a81674SSai Praneeth PrakhyaWhat:		/sys/kernel/iommu_groups/<grp_id>/type
3463a81674SSai Praneeth PrakhyaDate:		November 2020
3563a81674SSai Praneeth PrakhyaKernelVersion:	v5.11
3663a81674SSai Praneeth PrakhyaContact:	Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
3763a81674SSai Praneeth PrakhyaDescription:	/sys/kernel/iommu_groups/<grp_id>/type shows the type of default
3863a81674SSai Praneeth Prakhya		domain in use by iommu for this group. See include/linux/iommu.h
3962c9917dSLu Baolu		for possible read values. A privileged user could request kernel to
4062c9917dSLu Baolu		change the group type by writing to this file. Valid write values:
4162c9917dSLu Baolu
4262c9917dSLu Baolu		========  ======================================================
4362c9917dSLu Baolu		DMA       All the DMA transactions from the device in this group
4463a81674SSai Praneeth Prakhya		          are translated by the iommu.
45*26225beaSRobin Murphy		DMA-FQ    As above, but using batched invalidation to lazily
46*26225beaSRobin Murphy		          remove translations after use. This may offer reduced
47*26225beaSRobin Murphy			  overhead at the cost of reduced memory protection.
4862c9917dSLu Baolu		identity  All the DMA transactions from the device in this group
49*26225beaSRobin Murphy		          are not translated by the iommu. Maximum performance
50*26225beaSRobin Murphy			  but zero protection.
5162c9917dSLu Baolu		auto      Change to the type the device was booted with.
5262c9917dSLu Baolu		========  ======================================================
5362c9917dSLu Baolu
5463a81674SSai Praneeth Prakhya		The default domain type of a group may be modified only when
5562c9917dSLu Baolu
5662c9917dSLu Baolu		- The group has only one device.
5762c9917dSLu Baolu		- The device in the group is not bound to any device driver.
5863a81674SSai Praneeth Prakhya		  So, the users must unbind the appropriate driver before
5963a81674SSai Praneeth Prakhya		  changing the default domain type.
6062c9917dSLu Baolu
6163a81674SSai Praneeth Prakhya		Unbinding a device driver will take away the driver's control
6263a81674SSai Praneeth Prakhya		over the device and if done on devices that host root file
6363a81674SSai Praneeth Prakhya		system could lead to catastrophic effects (the users might
6463a81674SSai Praneeth Prakhya		need to reboot the machine to get it to normal state). So, it's
6563a81674SSai Praneeth Prakhya		expected that the users understand what they're doing.
66