[PATCH v4] swiotlb: fix implicit debugfs declarations

2021-06-30 Thread Claire Chang
Factor out the debugfs bits from rmem_swiotlb_device_init() into a separate rmem_swiotlb_debugfs_init() to fix the implicit debugfs declarations. Fixes: 461021875c50 ("swiotlb: Add restricted DMA pool initialization") Reported-by: kernel test robot Signed-off-by: Claire Chang ---

RE: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-06-30 Thread Krishna Reddy
> + > +err_pm_disable: > + pm_runtime_disable(dev); > return ret; > } Should it be pm_runtime_force_suspend()? qcom_iommu_device_remove() doesn't use pm_runtime_disable(dev). 875 static int qcom_iommu_device_remove(struct platform_device *pdev) 876 { ... 881

Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents

2021-06-30 Thread Leon Romanovsky
scatterlist. > > > > > > Fixes: 07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation > > > of SG table from pages") > > > Signed-off-by: Maor Gottlieb > > > Signed-off-by: Leon Romanovsky > > > > This patch landed

Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents

2021-06-30 Thread Thierry Reding
in the table. This is required for the release flow (sg_free_table). > > This filed should be used internally only by scatterlist. > > > > Fixes: 07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of > > SG table from pages") > > Sign

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Nathan Chancellor
Hi Will and Claire, On Wed, Jun 30, 2021 at 12:43:48PM +0100, Will Deacon wrote: > On Wed, Jun 30, 2021 at 05:17:27PM +0800, Claire Chang wrote: > > On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > > > > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > > >

Re: [PATCH v4 3/3] iommu: dart: Add DART iommu driver

2021-06-30 Thread Alyssa Rosenzweig
Looks really good! Just a few minor comments. With them addressed, Reviewed-by: Alyssa Rosenzweig > + Say Y here if you are using an Apple SoC with a DART IOMMU. Nit: Do we need to spell out "with a DART IOMMU"? Don't all the apple socs need DART? > +/* > + * This structure is

Re: [PATCH v4 1/3] iommu: io-pgtable: add DART pagetable format

2021-06-30 Thread Alyssa Rosenzweig
Reviewed-by: Alyssa Rosenzweig ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v4 2/3] dt-bindings: iommu: add DART iommu bindings

2021-06-30 Thread Alyssa Rosenzweig
Reviewed-by: Alyssa Rosenzweig ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-06-30 Thread Robin Murphy
On 2021-06-30 14:48, Marek Szyprowski wrote: On 30.06.2021 14:59, Will Deacon wrote: On Wed, Jun 30, 2021 at 02:48:15PM +0200, Marek Szyprowski wrote: On 08.06.2021 18:45, Amey Narkhede wrote: If device registration fails, remove sysfs attribute and if setting bus callbacks fails, unregister

Re: [PATCH v3] swiotlb: fix implicit debugfs_create_dir declaration

2021-06-30 Thread Robin Murphy
On 2021-06-30 05:06, Claire Chang wrote: Factor out the debugfs bits from rmem_swiotlb_device_init() into a separate rmem_swiotlb_debugfs_init(). Fixes: 461021875c50 ("swiotlb: Add restricted DMA pool initialization") Reported-by: kernel test robot Signed-off-by: Claire Chang ---

Re: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-06-30 Thread Marek Szyprowski
On 30.06.2021 14:59, Will Deacon wrote: > On Wed, Jun 30, 2021 at 02:48:15PM +0200, Marek Szyprowski wrote: >> On 08.06.2021 18:45, Amey Narkhede wrote: >>> If device registration fails, remove sysfs attribute >>> and if setting bus callbacks fails, unregister the device >>> and cleanup the sysfs

Re: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-06-30 Thread Will Deacon
On Wed, Jun 30, 2021 at 02:48:15PM +0200, Marek Szyprowski wrote: > On 08.06.2021 18:45, Amey Narkhede wrote: > > If device registration fails, remove sysfs attribute > > and if setting bus callbacks fails, unregister the device > > and cleanup the sysfs attribute. > > > > Signed-off-by: Amey

Re: [PATCH] iommu/arm: Cleanup resources in case of probe error path

2021-06-30 Thread Marek Szyprowski
Hi, On 08.06.2021 18:45, Amey Narkhede wrote: > If device registration fails, remove sysfs attribute > and if setting bus callbacks fails, unregister the device > and cleanup the sysfs attribute. > > Signed-off-by: Amey Narkhede This patch landed in linux-next some time ago as commit

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Will Deacon
On Wed, Jun 30, 2021 at 05:17:27PM +0800, Claire Chang wrote: > On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > > Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and > > > use it to determine

Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents

2021-06-30 Thread Leon Romanovsky
On Wed, Jun 30, 2021 at 01:12:26PM +0200, Marek Szyprowski wrote: > Hi Leon, > > On 29.06.2021 10:40, Leon Romanovsky wrote: > > From: Maor Gottlieb > > > > orig_nents should represent the number of entries with pages, > > but __sg_alloc_table_from_pages sets orig_nents as the number of > >

Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents

2021-06-30 Thread Marek Szyprowski
gt; Fixes: 07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of > SG table from pages") > Signed-off-by: Maor Gottlieb > Signed-off-by: Leon Romanovsky This patch landed in linux-next 20210630 as commit a52724456928 ("lib/scatterlist: Fix wrong update of o

Re: [PATCH] iommu/arm-smmu-v3: Add default domain quirk for Arm Fast Models

2021-06-30 Thread Robin Murphy
On 2021-06-30 09:56, Marc Zyngier wrote: On Tue, 29 Jun 2021 18:34:40 +0100, Will Deacon wrote: On Fri, Jun 18, 2021 at 05:24:49PM +0100, Robin Murphy wrote: Arm Fast Models are still implementing legacy virtio-pci devices behind the SMMU, which continue to be problematic as "real hardware"

Re: [PATCH 2/3] iommu/io-pgtable-arm: Add IOMMU_LLC page protection flag

2021-06-30 Thread Sai Prakash Ranjan
Hi Will, On 2021-03-25 23:03, Will Deacon wrote: On Tue, Mar 09, 2021 at 12:10:44PM +0530, Sai Prakash Ranjan wrote: On 2021-02-05 17:38, Sai Prakash Ranjan wrote: > On 2021-02-04 03:16, Will Deacon wrote: > > On Tue, Feb 02, 2021 at 11:56:27AM +0530, Sai Prakash Ranjan wrote: > > > On

Re: Re: [PATCH v8 10/10] Documentation: Add documentation for VDUSE

2021-06-30 Thread Stefan Hajnoczi
On Tue, Jun 29, 2021 at 01:43:11PM +0800, Yongji Xie wrote: > On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote: > > On Tue, Jun 15, 2021 at 10:13:31PM +0800, Xie Yongji wrote: > > > + static void *iova_to_va(int dev_fd, uint64_t iova, uint64_t *len) > > > + { > > > + int

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-30 Thread Stefan Hajnoczi
On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: > On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote: > > > > On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > > > +/* ioctls */ > > > + > > > +struct vduse_dev_config { > > > + char name[VDUSE_NAME_MAX]; /* vduse

Re: [PATCH v2 12/12] iommu: Do not allow IOMMU passthrough with Secure Launch

2021-06-30 Thread Ross Philipson
On 6/21/21 5:15 PM, Andy Lutomirski wrote: On Mon, Jun 21, 2021 at 10:51 AM Ross Philipson wrote: On 6/18/21 2:32 PM, Robin Murphy wrote: On 2021-06-18 17:12, Ross Philipson wrote: The IOMMU should always be set to default translated type after the PMRs are disabled to protect the MLE from

Re: [PATCH v2 12/12] iommu: Do not allow IOMMU passthrough with Secure Launch

2021-06-30 Thread Ross Philipson
On 6/22/21 7:06 AM, Robin Murphy wrote: On 2021-06-21 18:51, Ross Philipson wrote: On 6/18/21 2:32 PM, Robin Murphy wrote: On 2021-06-18 17:12, Ross Philipson wrote: The IOMMU should always be set to default translated type after the PMRs are disabled to protect the MLE from DMA.

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Claire Chang
On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and > > use it to determine whether to bounce the data or not. This will be > > useful later to allow

RE: [PATCH 3/6] vfio: remove the unused mdev iommu hook

2021-06-30 Thread Tian, Kevin
> From: Joerg Roedel > Sent: Monday, May 17, 2021 11:35 PM > > On Mon, May 17, 2021 at 10:35:00AM -0300, Jason Gunthorpe wrote: > > Well, I'm sorry, but there is a huge other thread talking about the > > IOASID design in great detail and why this is all needed. Jumping into > > this thread

Re: [PATCH] iommu/arm-smmu-v3: Add default domain quirk for Arm Fast Models

2021-06-30 Thread Marc Zyngier
On Tue, 29 Jun 2021 18:34:40 +0100, Will Deacon wrote: > > On Fri, Jun 18, 2021 at 05:24:49PM +0100, Robin Murphy wrote: > > Arm Fast Models are still implementing legacy virtio-pci devices behind > > the SMMU, which continue to be problematic as "real hardware" devices > > (from the point of

RE: [PATCH v5 7/8] iommu/arm-smmu: Get associated RMR info and install bypass SMR

2021-06-30 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Jon Nettleton [mailto:j...@solid-run.com] > Sent: 29 June 2021 17:26 > To: Robin Murphy > Cc: Shameerali Kolothum Thodi ; > linux-arm-kernel ; ACPI Devel Maling > List ; iommu@lists.linux-foundation.org; Linuxarm > ; Steven Price ; Guohanjun > (Hanjun Guo)

Re: [PATCH 01/24] dt-bindings: mediatek: mt8195: Add binding for MM IOMMU

2021-06-30 Thread Yong Wu
On Wed, 2021-06-30 at 08:26 +0200, Krzysztof Kozlowski wrote: > On 30/06/2021 04:34, Yong Wu wrote: > > This patch adds descriptions for mt8195 IOMMU which also use ARM > > Short-Descriptor translation table format. > > > > In mt8195, there are two smi-common HW and IOMMU, one is for vdo(video >

Re: [RFC] /dev/ioasid uAPI proposal

2021-06-30 Thread Christoph Hellwig
On Mon, Jun 07, 2021 at 11:14:24AM -0300, Jason Gunthorpe wrote: > "non-coherent DMA" is some general euphemism that evokes images of > embedded platforms that don't have coherent DMA at all and have low > cost ways to regain coherence. This is not at all what we are talking > about here at all.

Re: [RFC] /dev/ioasid uAPI proposal

2021-06-30 Thread Christoph Hellwig
On Fri, Jun 04, 2021 at 08:58:05AM -0300, Jason Gunthorpe wrote: > On Fri, Jun 04, 2021 at 09:11:03AM +0800, Jason Wang wrote: > > > nor do any virtio drivers implement the required platform specific > > > cache flushing to make no-snoop TLPs work. > > > > I don't get why virtio drivers needs to

Re: [RFC] /dev/ioasid uAPI proposal

2021-06-30 Thread Christoph Hellwig
On Wed, Jun 09, 2021 at 09:47:42AM -0300, Jason Gunthorpe wrote: > I can vaugely understand this rational for vfio, but not at all for > the platform's iommu driver, sorry. Agreed. More importantly the dependency is not for the platform iommu driver but just for the core iommu code, which is

Re: [RFC] /dev/ioasid uAPI proposal

2021-06-30 Thread Christoph Hellwig
On Mon, Jun 07, 2021 at 03:25:32AM +, Tian, Kevin wrote: > > Possibly just a naming thing, but I feel it's better to just talk about > no-snoop or non-coherent in the uAPI. Per Intel SDM wbinvd is a > privileged instruction. A process on the host has no privilege to > execute it. Only when

Re: [RFC] /dev/ioasid uAPI proposal

2021-06-30 Thread Christoph Hellwig
On Tue, Jun 08, 2021 at 09:20:29AM +0800, Jason Wang wrote: > " > > 6.2.17 _CCA (Cache Coherency Attribute) The _CCA object returns whether or > not a bus-master device supports hardware managed cache coherency. Expected > values are 0 to indicate it is not supported, and 1 to indicate that it is

Re: [RFC] /dev/ioasid uAPI proposal

2021-06-30 Thread Christoph Hellwig
On Mon, Jun 07, 2021 at 04:08:02PM -0300, Jason Gunthorpe wrote: > Compatibility is important, but when I look in the kernel code I see > very few places that call wbinvd(). Basically all DRM for something > relavent to qemu. > > That tells me that the vast majority of PCI devices do not generate

Re: [PATCH 02/24] dt-bindings: mediatek: mt8195: Add binding for infra IOMMU

2021-06-30 Thread Krzysztof Kozlowski
On 30/06/2021 04:34, Yong Wu wrote: > In mt8195, we have a new IOMMU that is for INFRA IOMMU. its masters > mainly are PCIe and USB. Different with MM IOMMU, all these masters > connect with IOMMU directly, there is no mediatek,larbs property for > infra IOMMU. > > Another thing is about PCIe

Re: [PATCH 01/24] dt-bindings: mediatek: mt8195: Add binding for MM IOMMU

2021-06-30 Thread Krzysztof Kozlowski
On 30/06/2021 04:34, Yong Wu wrote: > This patch adds descriptions for mt8195 IOMMU which also use ARM > Short-Descriptor translation table format. > > In mt8195, there are two smi-common HW and IOMMU, one is for vdo(video > output), the other is for vpp(video processing pipe). They connects >