> >>> +free_prev_domain: > >>> + /* > >>> + * Free the existing default domain and replace it with the newly > >>> + * created default domain. No need to set group->domain because > >>> + * __iommu_attach_group() already does it on success. > >>> + */ > >>> + iommu_domain_free(prev_domain); > >>> + group->default_domain = new_domain; > >>> + return 0; > >> > >> It isn't obvious to me from this patch, how to are the dma_ops > >> updated when the default domain changes between identity and dma? > > > > Thanks for raising this. > > For intel_iommu, dma_map_ops is defined at drivers/iommu/intel-iommu.c > > and all the callbacks like alloc(), map_sg() and map_page(), check if > > the device needs DMA mapping or not by calling iommu_need_mapping(). The > callbacks inherently do the right thing based on the outcome. > > So, essentially the dma_ops are same for dma/identity domain. > > This isn't always true as we are considering per-device dma ops.
Ahh.. I see. I wasn't aware that per-device dma ops might change this. Thanks for letting me know. I will take this into consideration as well for V2. Regards, Sai _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu