All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Will Deacon <will@kernel.org>, Ashok Raj <ashok.raj@intel.com>
Cc: Will Deacon <will.deacon@arm.com>,
	iommu@lists.linux-foundation.org,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [Patch V8 3/3] iommu: Document usage of "/sys/kernel/iommu_groups/<grp_id>/type" file
Date: Thu, 19 Nov 2020 10:32:43 +0800	[thread overview]
Message-ID: <7eeae289-070f-c5c9-aff5-edbb8437ef69@linux.intel.com> (raw)
In-Reply-To: <20201118135137.GA2177@willie-the-truck>

Hi Will,

On 11/18/20 9:51 PM, Will Deacon wrote:
> On Fri, Sep 25, 2020 at 12:06:20PM -0700, Ashok Raj wrote:
>> From: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
>>
>> The default domain type of an iommu group can be changed by writing to
>> "/sys/kernel/iommu_groups/<grp_id>/type" file. Hence, document it's usage
>> and more importantly spell out its limitations.
>>
>> Cc: Christoph Hellwig <hch@lst.de>
>> Cc: Joerg Roedel <joro@8bytes.org>
>> Cc: Ashok Raj <ashok.raj@intel.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> Cc: Lu Baolu <baolu.lu@linux.intel.com>
>> Cc: Sohil Mehta <sohil.mehta@intel.com>
>> Cc: Robin Murphy <robin.murphy@arm.com>
>> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
>> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
>> Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
>> ---
>>   .../ABI/testing/sysfs-kernel-iommu_groups          | 30 ++++++++++++++++++++++
>>   1 file changed, 30 insertions(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-kernel-iommu_groups b/Documentation/ABI/testing/sysfs-kernel-iommu_groups
>> index 017f5bc3920c..effde9d23f4f 100644
>> --- a/Documentation/ABI/testing/sysfs-kernel-iommu_groups
>> +++ b/Documentation/ABI/testing/sysfs-kernel-iommu_groups
>> @@ -33,3 +33,33 @@ 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:		September 2020
>> +KernelVersion:	v5.10
> 
> ^^ Please can you update these two lines?

Sure.

> 
>> +Contact:	Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
>> +Description:	Let the user know the type of default domain in use by iommu
>> +		for this group. A privileged user could request kernel to change
>> +		the group type by writing to this file. Presently, only three
>> +		types are supported
>> +		1. DMA: All the DMA transactions from the device in this group
>> +			are translated by the iommu.
>> +		2. identity: All the DMA transactions from the device in this
>> +			     group are *not* translated by the iommu.
>> +		3. auto: Change to the type the device was booted with. When the
>> +			 user reads the file he would never see "auto". This is
> 
> Can we avoid assuming gender here and just use "they" instead of "he", please?
> Same thing for the "Caution" note below.

Yes, absolutely.

> 
>> +			 just a write only value.
> 
> I can't figure out from this description what string is returned to
> userspace in the case that the group is configured as  blocked or unmanaged.

This series only enables switching a default domain in use between DMA
and IDENTITY. Other cases will result in write failures.

> 
>> +		Note:
>> +		-----
>> +		A group type could be modified only when
> 
> s/could be/may be/
> 
>> +		1. The group has *only* one device
>> +		2. The device in the group is not bound to any device driver.
>> +		   So, the user must first unbind the appropriate driver and
>> +		   then change the default domain type.
>> +		Caution:
>> +		--------
>> +		Unbinding a device driver will take away the driver's 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.
> 
> Thanks,
> 
> Will

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

  reply	other threads:[~2020-11-19  2:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 19:06 [Patch V8 0/3] iommu: Add support to change default domain of an iommu group Ashok Raj
2020-09-25 19:06 ` [Patch V8 1/3] " Ashok Raj
2020-11-18 13:51   ` Will Deacon
2020-11-19  2:18     ` Lu Baolu
2020-11-19  8:53       ` Will Deacon
2020-11-20  2:11         ` Lu Baolu
2020-11-20 11:03           ` Will Deacon
2020-11-20 11:27   ` Shameerali Kolothum Thodi
2020-11-20 13:09     ` Lu Baolu
2020-09-25 19:06 ` [Patch V8 2/3] iommu: Take lock before reading iommu group default domain type Ashok Raj
2020-09-25 19:06 ` [Patch V8 3/3] iommu: Document usage of "/sys/kernel/iommu_groups/<grp_id>/type" file Ashok Raj
2020-11-18 13:51   ` Will Deacon
2020-11-19  2:32     ` Lu Baolu [this message]
2020-11-19  8:55       ` Will Deacon
2020-11-20  2:13         ` Lu Baolu
2020-10-01 12:58 ` [Patch V8 0/3] iommu: Add support to change default domain of an iommu group Joerg Roedel
2020-10-01 13:51   ` Raj, Ashok
2020-11-18 13:52 ` Will Deacon
2020-11-19  2:36   ` Lu Baolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7eeae289-070f-c5c9-aff5-edbb8437ef69@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=robin.murphy@arm.com \
    --cc=will.deacon@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.