RE: [PATCH v2] iommu/vt-d: Make DMAR_UNITS_SUPPORTED a config setting

2022-05-23 Thread Tian, Kevin
> From: Steve Wahl > Sent: Thursday, May 19, 2022 3:58 AM > > On Fri, May 13, 2022 at 10:09:46AM +0800, Baolu Lu wrote: > > On 2022/5/13 07:12, Steve Wahl wrote: > > > On Thu, May 12, 2022 at 10:13:09AM -0500, Steve Wahl wrote: > > > > To support up to 64 sockets with 10 DMAR units each (640),

Re: [PATCH v4 4/6] iommu: Add PASID support for DMA mapping API users

2022-05-23 Thread Jacob Pan
Hi Kevin, On Mon, 23 May 2022 08:25:33 +, "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Thursday, May 19, 2022 2:21 AM > > > > DMA mapping API is the de facto standard for in-kernel DMA. It operates > > on a per device/RID basis which is not PASID-aware. > > > > Some modern devices

Re: [PATCH 0/2] dma-mapping, remoteproc: Fix dma_mem leak after rproc_shutdown

2022-05-23 Thread Mark-PK Tsai via iommu
> >> Sigh. In theory drivers should never declare coherent memory like > >> this, and there has been some work to fix remoteproc in that regard. > >> > >> But I guess until that is merged we'll need somthing like this fix. > > > > Hi, > > > > Thanks for your comment. > > As I didn't see other

Re: [PATCH V2 0/6] IOMMU-DMA - support DMA_ATTR_LOW_ADDRESS attribute

2022-05-23 Thread Ajay Kumar
Ping! On Thu, May 12, 2022 at 9:09 AM Ajay Kumar wrote: > > This patchset is a rebase of original patches from Marek Szyprowski: > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2321261.html > > The patches have been rebased on Joro's IOMMU tree "next" branch: >

Re: [PATCH] iommu/ipmmu-vmsa: Avoid leak OF node on error

2022-05-23 Thread Robin Murphy
On 2022-05-23 12:54, Johan Hovold wrote: On Mon, May 23, 2022 at 11:11:45AM +, cgel@gmail.com wrote: From: Minghao Chi The OF node should be put before returning error in ipmmu_init(), otherwise node's refcount will be leaked. Reported-by: Zeal Robot Signed-off-by: Minghao Chi ---

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-23 Thread Nathan Chancellor
On Fri, May 20, 2022 at 05:15:55PM -0700, Saravana Kannan wrote: > On Fri, May 20, 2022 at 5:04 PM Nathan Chancellor wrote: > > > > On Fri, May 20, 2022 at 04:49:48PM -0700, Saravana Kannan wrote: > > > On Fri, May 20, 2022 at 4:30 PM Nathan Chancellor > > > wrote: > > > > > > > > Hi Saravana,

Re: [PATCH RFC 11/12] iommufd: vfio container FD ioctl compatibility

2022-05-23 Thread Alexey Kardashevskiy
On 4/29/22 00:53, David Gibson wrote: On Thu, Mar 24, 2022 at 04:04:03PM -0600, Alex Williamson wrote: On Wed, 23 Mar 2022 21:33:42 -0300 Jason Gunthorpe wrote: On Wed, Mar 23, 2022 at 04:51:25PM -0600, Alex Williamson wrote: My overall question here would be whether we can actually

[PATCH] iommu/arm-smmu-qcom: Add debug support for TLB sync timeouts

2022-05-23 Thread Sai Prakash Ranjan
TLB sync timeouts can be due to various reasons such as TBU power down or pending TCU/TBU invalidation/sync and so on. Debugging these often require dumping of some implementation defined registers to know the status of TBU/TCU operations and some of these registers are not accessible in

Re: [PATCH V2 2/6] iommu: iova: properly handle 0 as a valid IOVA address

2022-05-23 Thread Robin Murphy
On 2022-05-11 13:15, Ajay Kumar wrote: From: Marek Szyprowski Zero is a valid DMA and IOVA address on many architectures, so adjust the IOVA management code to properly handle it. A new value IOVA_BAD_ADDR (~0UL) is introduced as a generic value for the error case. Adjust all callers of the

Re: [PATCH v4 2/6] iommu: Add a helper to do PASID lookup from domain

2022-05-23 Thread Jacob Pan
Hi Kevin, On Mon, 23 May 2022 09:14:04 +, "Tian, Kevin" wrote: > > From: Tian, Kevin > > Sent: Monday, May 23, 2022 3:55 PM > > > > > From: Jacob Pan > > > +ioasid_t iommu_get_pasid_from_domain(struct device *dev, struct > > > iommu_domain *domain) > > > +{ > > > + struct iommu_domain

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-23 Thread Saravana Kannan via iommu
On Mon, May 23, 2022 at 8:17 AM Nathan Chancellor wrote: > > On Fri, May 20, 2022 at 05:15:55PM -0700, Saravana Kannan wrote: > > On Fri, May 20, 2022 at 5:04 PM Nathan Chancellor wrote: > > > > > > On Fri, May 20, 2022 at 04:49:48PM -0700, Saravana Kannan wrote: > > > > On Fri, May 20, 2022 at

Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-23 Thread John Garry via iommu
On 21/05/2022 00:33, Damien Le Moal wrote: Hi Damien, +unsigned long iova_rcache_range(void) Why not a size_t return type ? The IOVA code generally uses unsigned long for size/range while dam-iommu uses size_t as appropiate, so I'm just sticking to that. +{ + return PAGE_SIZE <<

RE: [PATCH v4 2/6] iommu: Add a helper to do PASID lookup from domain

2022-05-23 Thread Tian, Kevin
> From: Jacob Pan > Sent: Thursday, May 19, 2022 2:21 AM > > IOMMU group maintains a PASID array which stores the associated IOMMU > domains. This patch introduces a helper function to do domain to PASID > look up. It will be used by TLB flush and device-PASID attach verification. > >

RE: [PATCH v4 4/6] iommu: Add PASID support for DMA mapping API users

2022-05-23 Thread Tian, Kevin
> From: Jacob Pan > Sent: Thursday, May 19, 2022 2:21 AM > > DMA mapping API is the de facto standard for in-kernel DMA. It operates > on a per device/RID basis which is not PASID-aware. > > Some modern devices such as Intel Data Streaming Accelerator, PASID is > required for certain work

Re: [PATCH 0/2] dma-mapping, remoteproc: Fix dma_mem leak after rproc_shutdown

2022-05-23 Thread Mark-PK Tsai via iommu
> Sigh. In theory drivers should never declare coherent memory like > this, and there has been some work to fix remoteproc in that regard. > > But I guess until that is merged we'll need somthing like this fix. Hi, Thanks for your comment. As I didn't see other fix of this issue, should we use

[PATCH] iommu/ipmmu-vmsa: Avoid leak OF node on error

2022-05-23 Thread cgel . zte
From: Minghao Chi The OF node should be put before returning error in ipmmu_init(), otherwise node's refcount will be leaked. Reported-by: Zeal Robot Signed-off-by: Minghao Chi --- drivers/iommu/ipmmu-vmsa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: [PATCH] iommu/ipmmu-vmsa: Avoid leak OF node on error

2022-05-23 Thread Johan Hovold
On Mon, May 23, 2022 at 11:11:45AM +, cgel@gmail.com wrote: > From: Minghao Chi > > The OF node should be put before returning error in ipmmu_init(), > otherwise node's refcount will be leaked. > > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- >

Re: [PATCH 0/4] DMA mapping changes for SCSI core

2022-05-23 Thread John Garry via iommu
On 22/05/2022 23:22, Damien Le Moal wrote: On 2022/05/22 22:13, Christoph Hellwig wrote: The whole series looks fine to me. I'll happily queue it up in the dma-mapping tree if the SCSI and ATA maintainers are ok with that. Fine with me. I sent an acked-by for the libata bit. Thanks, I'm

Re: [PATCH 3/4] scsi: core: Cap shost max_sectors according to DMA optimum mapping limits

2022-05-23 Thread John Garry via iommu
On 21/05/2022 00:30, Damien Le Moal wrote: diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index f69b77cbf538..a3ae6345473b 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -225,6 +225,11 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,

Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-23 Thread Damien Le Moal via iommu
On 2022/05/20 17:23, John Garry wrote: > Add the IOMMU callback for DMA mapping API dma_opt_mapping_size(), which > allows the drivers to know the optimal mapping limit and thus limit the > requested IOVA lengths. > > This value is based on the IOVA rcache range limit, as IOVAs allocated > above

Re: [PATCH 3/4] scsi: core: Cap shost max_sectors according to DMA optimum mapping limits

2022-05-23 Thread Damien Le Moal via iommu
On 2022/05/23 15:53, John Garry wrote: > On 21/05/2022 00:30, Damien Le Moal wrote: >>> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c >>> index f69b77cbf538..a3ae6345473b 100644 >>> --- a/drivers/scsi/hosts.c >>> +++ b/drivers/scsi/hosts.c >>> @@ -225,6 +225,11 @@ int

RE: [PATCH v4 2/6] iommu: Add a helper to do PASID lookup from domain

2022-05-23 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Monday, May 23, 2022 3:55 PM > > > From: Jacob Pan > > +ioasid_t iommu_get_pasid_from_domain(struct device *dev, struct > > iommu_domain *domain) > > +{ > > + struct iommu_domain *tdomain; > > + struct iommu_group *group; > > + unsigned long index; > > +

Re: [PATCH 3/4] scsi: core: Cap shost max_sectors according to DMA optimum mapping limits

2022-05-23 Thread Dan Carpenter
Hi John, url: https://github.com/intel-lab-lkp/linux/commits/John-Garry/DMA-mapping-changes-for-SCSI-core/20220520-163049 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next config: s390-randconfig-m031-20220519

Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support

2022-05-23 Thread Baolu Lu
On 2022/5/19 15:20, Lu Baolu wrote: The iommu_sva_domain represents a hardware pagetable that the IOMMU hardware could use for SVA translation. This adds some infrastructure to support SVA domain in the iommu common layer. It includes: - Add a new struct iommu_sva_domain and new

Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-23 Thread Damien Le Moal via iommu
On 2022/05/23 16:01, John Garry wrote: > On 21/05/2022 00:33, Damien Le Moal wrote: > > Hi Damien, > >>> +unsigned long iova_rcache_range(void) >> Why not a size_t return type ? > > The IOVA code generally uses unsigned long for size/range while > dam-iommu uses size_t as appropiate, so I'm

Re: [PATCH 0/2] dma-mapping, remoteproc: Fix dma_mem leak after rproc_shutdown

2022-05-23 Thread Robin Murphy
On 2022-05-23 11:15, Mark-PK Tsai wrote: Sigh. In theory drivers should never declare coherent memory like this, and there has been some work to fix remoteproc in that regard. But I guess until that is merged we'll need somthing like this fix. Hi, Thanks for your comment. As I didn't see

Re: [PATCH 3/4] scsi: core: Cap shost max_sectors according to DMA optimum mapping limits

2022-05-23 Thread John Garry via iommu
On 23/05/2022 12:08, Dan Carpenter wrote: Thanks for the report 50b6cb3516365c Dexuan Cui2021-10-07 224/* Use min_t(int, ...) in case shost->can_queue exceeds SHRT_MAX */ 50b6cb3516365c Dexuan Cui2021-10-07 225shost->cmd_per_lun = min_t(int,

Re: [PATCH] iommu/arm-smmu-qcom: Add debug support for TLB sync timeouts

2022-05-23 Thread Sai Prakash Ranjan
On 5/23/2022 10:48 PM, Sai Prakash Ranjan wrote: TLB sync timeouts can be due to various reasons such as TBU power down or pending TCU/TBU invalidation/sync and so on. Debugging these often require dumping of some implementation defined registers to know the status of TBU/TCU operations and some

Re: [PATCH 0/4] DMA mapping changes for SCSI core

2022-05-23 Thread Martin K. Petersen
Christoph, > The whole series looks fine to me. I'll happily queue it up in the > dma-mapping tree if the SCSI and ATA maintainers are ok with that. Works for me. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-23 Thread Nathan Chancellor
de, please let me know! > > > > > > > > > > Hmm... strange. Can you please try the following command line options > > > > > and tell me which of these has the issue and which don't? > > > > > > > > Sure thing! > > > > &g

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-23 Thread Saravana Kannan via iommu
; > > > > > > > > > We have a simple rootfs available if necessary: > > > > > > > > > > > > > > https://github.com/ClangBuiltLinux/boot-utils/raw/bc0d17785eb67f1edd0ee0a134970a807895f741/images/s390/rootfs.cpio.zst > > > >