From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Date: Tue, 20 Sep 2022 13:43:16 +0000 Subject: Re: [PATCH kernel v2 3/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking dom Message-Id: List-Id: References: <20220920130457.29742-1-aik@ozlabs.ru> <20220920130457.29742-4-aik@ozlabs.ru> In-Reply-To: <20220920130457.29742-4-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexey Kardashevskiy Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, Nicholas Piggin , Michael Ellerman , Frederic Barrat , Alex Williamson , kvm-ppc@vger.kernel.org, Deming Wang , Robin Murphy , Daniel Henrique Barboza , Fabiano Rosas , Murilo Opsfelder Araujo On Tue, Sep 20, 2022 at 11:04:57PM +1000, Alexey Kardashevskiy wrote: > Up until now PPC64 managed to avoid using iommu_ops. The VFIO driver > uses a SPAPR TCE sub-driver and all iommu_ops uses were kept in > the Type1 VFIO driver. Recent development added 2 uses of iommu_ops to > the generic VFIO which broke POWER: > - a coherency capability check; > - blocking IOMMU domain - iommu_group_dma_owner_claimed()/... > > This adds a simple iommu_ops which reports support for cache > coherency and provides a basic support for blocking domains. No other > domain types are implemented so the default domain is NULL. > > Since now iommu_ops controls the group ownership, this takes it out of > VFIO. > > This adds an IOMMU device into a pci_controller (=PHB) and registers it > in the IOMMU subsystem, iommu_ops is registered at this point. > This setup is done in postcore_initcall_sync. > > This replaces iommu_group_add_device() with iommu_probe_device() as > the former misses necessary steps in connecting PCI devices to IOMMU > devices. This adds a comment about why explicit iommu_probe_device() > is still needed. > > Fixes: e8ae0e140c05 ("vfio: Require that devices support DMA cache coherence") > Fixes: 70693f470848 ("vfio: Set DMA ownership for VFIO devices") > Cc: Deming Wang > Cc: Robin Murphy > Cc: Jason Gunthorpe > Cc: Alex Williamson > Cc: Daniel Henrique Barboza > Cc: Fabiano Rosas > Cc: Murilo Opsfelder Araujo > Cc: Nicholas Piggin > Signed-off-by: Alexey Kardashevskiy > --- > Changes: > v2: > * replaced a default domain with blocked Code wise this is much better.. But it is a bit unsettling to see the blocked domain co-opted to mean 'some platform specific VFIO behavior' - don't have a better idea for this series though. Reviewed-by: Jason Gunthorpe Jason