Re: [PATCH RFC v2 02/11] iommu: Add iommu_group_singleton_lockdown()

2022-03-31 Thread Yi Liu
On 2022/3/29 19:42, Jason Gunthorpe wrote: On Tue, Mar 29, 2022 at 08:42:13AM +, Tian, Kevin wrote: btw I'm not sure whether this is what SVA requires. IIRC the problem with SVA is because PASID TLP prefix is not counted in PCI packet routing thus a DMA target address with PASID might be

Re: [PATCH RFC v2 02/11] iommu: Add iommu_group_singleton_lockdown()

2022-03-31 Thread Yi Liu
On 2022/3/29 16:42, Tian, Kevin wrote: From: Lu Baolu Sent: Tuesday, March 29, 2022 1:38 PM Some of the interfaces in the IOMMU core require that only a single kernel device driver controls the device in the IOMMU group. The existing method is to check the device count in the IOMMU group in t

[PATCH v3] iommu/vt-d: calculate mask for non-aligned flushes

2022-03-31 Thread David Stevens
From: David Stevens Calculate the appropriate mask for non-size-aligned page selective invalidation. Since psi uses the mask value to mask out the lower order bits of the target address, properly flushing the iotlb requires using a mask value such that [pfn, pfn+pages) all lie within the flushed

Re: [PATCH RFC v2 08/11] iommu/sva: Use attach/detach_pasid_dev in SVA interfaces

2022-03-31 Thread Jason Gunthorpe via iommu
On Thu, Mar 31, 2022 at 01:59:22PM -0700, Jacob Pan wrote: > > + handle->dev = dev; > > + handle->domain = domain; > > + handle->pasid = mm->pasid; > why do we need to store pasid here? Conceptually, pasid is per sva domain > not per bind. You can get it from handle->domain->sva_cookie. Th

Re: [PATCH] iommu/omap: Fix regression in probe for NULL pointer dereference

2022-03-31 Thread Drew Fustini
On TLhu, Mar 31, 2022 at 09:23:01AM +0300, Tony Lindgren wrote: > Commit 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") started > triggering a NULL pointer dereference for some omap variants: > > __iommu_probe_device from probe_iommu_group+0x2c/0x38 > probe_iommu_group from bus_for_ea

Re: [PATCH RFC v2 08/11] iommu/sva: Use attach/detach_pasid_dev in SVA interfaces

2022-03-31 Thread Jacob Pan
Hi Lu, On Tue, 29 Mar 2022 13:37:57 +0800, Lu Baolu wrote: > The existing iommu SVA interfaces are implemented by calling the SVA > specific iommu ops provided by the IOMMU drivers. There's no need for > any SVA specific ops in iommu_ops vector anymore as we can achieve > this through the generi

Re: [PATCH] dma-mapping: move pgprot_decrypted out of dma_pgprot

2022-03-31 Thread Christoph Hellwig
On Thu, Mar 31, 2022 at 12:13:19PM -0400, Alex Xu (Hello71) wrote: > Tested-by: Alex Xu (Hello71) Thanks! ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v2 1/5] dt-bindings: reserved-memory: Document memory region specifier

2022-03-31 Thread Thierry Reding
On Fri, Feb 11, 2022 at 12:15:44AM +0100, Janne Grunau wrote: > On 2022-02-09 17:31:16 +0100, Thierry Reding wrote: > > On Sun, Feb 06, 2022 at 11:27:00PM +0100, Janne Grunau wrote: > > > On 2021-09-15 17:19:39 +0200, Thierry Reding wrote: > > > > On Tue, Sep 07, 2021 at 07:44:44PM +0200, Thierry R

Re: [PATCH] dma-mapping: move pgprot_decrypted out of dma_pgprot

2022-03-31 Thread Alex Xu (Hello71) via iommu
Excerpts from Christoph Hellwig's message of March 31, 2022 2:06 am: > pgprot_decrypted is used by AMD SME systems to allow access to memory > that was set to not encrypted using set_memory_decrypted. That only > happens for dma-direct memory as the IOMMU solves the addressing > challenges for the

Re: [PATCH] iommu/omap: Fix regression in probe for NULL pointer dereference

2022-03-31 Thread Jason Gunthorpe
On Thu, Mar 31, 2022 at 09:23:01AM +0300, Tony Lindgren wrote: > Commit 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") started > triggering a NULL pointer dereference for some omap variants: > > __iommu_probe_device from probe_iommu_group+0x2c/0x38 > probe_iommu_group from bus_for_eac

Re: "dma-mapping: remove CONFIG_DMA_REMAP" causes AMD SME boot fail

2022-03-31 Thread Thorsten Leemhuis
[TLDR: I'm adding the regression report below to regzbot, the Linux kernel regression tracking bot; all text you find below is compiled from a few templates paragraphs you might have encountered already already from similar mails.] Hi, this is your Linux kernel regression tracker. Sending this jus

Re: [PATCH v4 8/9] iommu: Remove unused argument in is_attach_deferred

2022-03-31 Thread Drew Fustini
On Wed, Mar 30, 2022 at 02:33:23PM -0300, Jason Gunthorpe wrote: > On Wed, Mar 30, 2022 at 08:19:37PM +0300, Tony Lindgren wrote: > > > > > __iommu_probe_device from probe_iommu_group+0x2c/0x38 > > > > probe_iommu_group from bus_for_each_dev+0x74/0xbc > > > > bus_for_each_dev from bus_iommu_probe+

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-31 Thread Jason Gunthorpe via iommu
On Wed, Mar 30, 2022 at 09:35:52PM +0800, Yi Liu wrote: > > +/** > > + * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY) > > + * @size: sizeof(struct iommu_ioas_copy) > > + * @flags: Combination of enum iommufd_ioas_map_flags > > + * @dst_ioas_id: IOAS ID to change the mapping of > > + * @src_ioas

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-31 Thread Jason Gunthorpe via iommu
On Thu, Mar 31, 2022 at 03:36:29PM +1100, David Gibson wrote: > > +/** > > + * struct iommu_ioas_iova_ranges - ioctl(IOMMU_IOAS_IOVA_RANGES) > > + * @size: sizeof(struct iommu_ioas_iova_ranges) > > + * @ioas_id: IOAS ID to read ranges from > > + * @out_num_iovas: Output total number of ranges in t