> > > > Sure! Makes sense.. per-group default domain type sounds good. > > > > I am planning to implement an RFC (supporting only runtime case for > > now) which works as below > > > > 1. User unbinds the driver by writing to sysfs 2. User puts a group in > > pass through mode by writing "1" to > > /sys/kernel/iommu_groups/<group_id>/pt > > might be better to read current value of default domain for that group.. > /sys/kernel/iommu_groups/<group_id>/default_domain
Presently, we already have a file that gives out "type" of default_domain and the file is /sys/kernel/iommu_groups/<group_id>/type > reading the above value shows current setting. > provide a differnet file next_def_domain, and you can echo "pt" or > "dma_domain" > to switch to pass-through, or normal dma isolation mode. We have couple of options here: 1. Since we already have "type" file, which is "read-only", we could make it R/W. The present value shows the existing type of default domain. If user wants to change it (Eg: from DMA to IDENTITY or vice versa), he attempts to write the new value. Kernel performs checks to make sure that the driver in unbinded and it's safe to change the default domain type. After successfully changing the default_domain type internally, kernel reflects the new value in the file. Ay errors in the process will be reported in dmesg. 2. As you have suggested, we could have a *new* file named "next_def_domain_type", which takes string as an input. Please let me know if there is any preference among these approaches and why :) Regards, Sai _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
