Re: [PATCH v2 3/7] iommu: Make iommu_dma_prepare_msi() into a generic operation

2025-02-27 Thread Jason Gunthorpe
On Thu, Feb 27, 2025 at 09:46:55AM -0800, Nicolin Chen wrote: > I found a bit confusing to use "owner" as the domain->owner isn't > the same thing in this context. Maybe it should be "driver_ops"? Maybe, but I wouldn't churn it > Then, "owner" could be another op structure that holds the owner- >

Re: [PATCH v2 3/7] iommu: Make iommu_dma_prepare_msi() into a generic operation

2025-02-27 Thread Nicolin Chen
On Thu, Feb 27, 2025 at 11:32:42AM -0400, Jason Gunthorpe wrote: > On Thu, Feb 27, 2025 at 11:21:28AM +, Robin Murphy wrote: > > All I'm saying is to hide the callback detail in the IOMMUFD code because > > being IOMMUFD modular is unique to IOMMUFD and not the rest of the core > > code's probl

Re: [PATCH v2 3/7] iommu: Make iommu_dma_prepare_msi() into a generic operation

2025-02-27 Thread Jason Gunthorpe
On Thu, Feb 27, 2025 at 11:21:28AM +, Robin Murphy wrote: > It wouldn't need a hard dependency, it's easy to have a trivial built-in > stub function which becomes valid once the module loads - you literally have > the iommufd_driver infrastructure for precisely that sort of thing already. Yes

Re: [PATCH v2 3/7] iommu: Make iommu_dma_prepare_msi() into a generic operation

2025-02-27 Thread Robin Murphy
On 2025-02-21 4:44 pm, Jason Gunthorpe wrote: On Fri, Feb 21, 2025 at 03:39:45PM +, Robin Murphy wrote: Yuck. Realistically we are going to have no more than two different implementations of this; a fiddly callback interface seems overkill. All we should need in the domain is a simple indica

Re: [PATCH v2 3/7] iommu: Make iommu_dma_prepare_msi() into a generic operation

2025-02-21 Thread Jason Gunthorpe
On Fri, Feb 21, 2025 at 03:39:45PM +, Robin Murphy wrote: > Yuck. Realistically we are going to have no more than two different > implementations of this; a fiddly callback interface seems overkill. All we > should need in the domain is a simple indicator of *which* MSI translation > scheme is

Re: [PATCH v2 3/7] iommu: Make iommu_dma_prepare_msi() into a generic operation

2025-02-21 Thread Robin Murphy
On 2025-02-20 1:31 am, Nicolin Chen wrote: From: Jason Gunthorpe SW_MSI supports IOMMU to translate an MSI message before the MSI message is delivered to the interrupt controller. On such systems, an iommu_domain must have a translation for the MSI message for interrupts to work. The IRQ subsy