I don't know why people are being dropped randomly from CC'list. So, adding
them back

+ Sohil, Jacob, Joerg, Baolu

> > +What:              /sys/kernel/iommu_groups/<grp_id>/type
> > +Date:              August 2019
> > +KernelVersion:     v5.4
> > +Contact:   Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com>
> > +Description:       /sys/kernel/iommu_groups/<grp_id>/type lets 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
> 
> It's unclear whether the following is a list of all values the user 
> could both read and write (which it isn't).

Thanks for bringing this up.
True.. user would never see "auto" when he reads this file. I will make it
clear in V2.

> 
> > +           1. dma: All the DMA transactions from the devices in this
> > group
> > +                   are translated by the iommu.
> 
> Why "dma", and not "DMA" (which is what we would read for DMA type)?

Makes sense.. Will change to "DMA" in V2.

> 
> > +           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
> 
> Isn't this the same as reset value, which we could read and remember?

Agreed. But, I think (assuming it's done manually and the user hasn't stored
default value in some script), remembering would be difficult if the system
had been running for weeks together and the user had already changed group
type multiple times.

> (And the kernel could reject when we attempt to change to a disallowed 
> type).

It already does and I see your point.
Since there are only two options, user might try to write "DMA" and if the
kernel disallows he would write "identity", simple enough.

I think of "auto" as an add-on feature. Since it's simple enough to implement
in kernel and reduces one extra step to user.

> 
> > +           Note:
> > +           -----
> > +           A group type could be modified only when *all* the devices in
> > +           the group are not binded to any device driver. So, the user
> > has
> > +           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.
> 
> I think that this goes without saying.

Haha.. Yes, it does. But, just wanted to be explicit so that new users are
warned well before :)

Regards,
Sai

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

Reply via email to