Re: [PATCHv3] iommu/arm-smmu: Optimize ->tlb_flush_walk() for qcom implementation

2021-07-20 Thread Sai Prakash Ranjan
Hi Robin, Will, On 2021-07-12 09:39, Sai Prakash Ranjan wrote: Hi Robin, On 2021-06-23 19:12, Sai Prakash Ranjan wrote: Currently for iommu_unmap() of large scatter-gather list with page size elements, the majority of time is spent in flushing of partial walks in __arm_lpae_unmap() which is

RE: [RFC v2] /dev/iommu uAPI proposal

2021-07-20 Thread Tian, Kevin
> From: Shenming Lu > Sent: Friday, July 16, 2021 8:20 PM > > On 2021/7/16 9:20, Tian, Kevin wrote: > > To summarize, for vIOMMU we can work with the spec owner to > > define a proper interface to feedback such restriction into the guest > > if necessary. For the kernel part, it's clear that IOMM

RE: [RFC v2] /dev/iommu uAPI proposal

2021-07-20 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Saturday, July 17, 2021 2:30 AM > > On Fri, Jul 16, 2021 at 01:20:15AM +, Tian, Kevin wrote: > > > One thought is to have vfio device driver deal with it. In this proposal > > it is the vfio device driver to define the PASID virtualization policy and > > repor

Re: [PATCH 4/5] iommu/vt-d: Disallow SVA if devices don't support 64-bit address

2021-07-20 Thread Lu Baolu
Hi Robin, Thanks a lot for reviewing my patch! On 7/20/21 5:27 PM, Robin Murphy wrote: On 2021-07-20 02:38, Lu Baolu wrote: When the device and CPU share an address space (such as SVA), the device must support the same addressing capability as the CPU. The CPU does not consider the addressing

Re: [bug report] iommu_dma_unmap_sg() is very slow then running IO from remote numa node

2021-07-20 Thread Ming Lei
On Mon, Jul 19, 2021 at 05:14:28PM +0100, John Garry wrote: > On 09/07/2021 15:24, Ming Lei wrote: > > > associated compromises. > > Follows the log of 'perf report' > > > > 1) good(run fio from cpus in the nvme's numa node) > > Hi Ming, > > If you're still interested in this issue, as an experi

[PATCH -next] iommu/arm-smmu-v3: Add suspend and resume support

2021-07-20 Thread Bixuan Cui
Add suspend and resume support for arm-smmu-v3 by low-power mode. When the smmu is suspended, it is powered off and the registers are cleared. So saves the msi_msg context during msi interrupt initialization of smmu. When resume happens it calls arm_smmu_device_reset() to restore the registers. S

Re: [PATCH] iommu/amd: Fix I/O page fault logging ratelimit test

2021-07-20 Thread Suthikulpanit, Suravee via iommu
Hi Lennert, On 7/18/2021 7:47 PM, Lennert Buytenhek wrote: On an AMD system, I/O page faults are usually logged like this: diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 811a49a95d04..7ae426b092f2 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu

Re: [PATCH] dt-bindings: More dropping redundant minItems/maxItems

2021-07-20 Thread Stephen Boyd
Quoting Rob Herring (2021-07-13 12:34:53) > Another round of removing redundant minItems/maxItems from new schema in > the recent merge window. > > If a property has an 'items' list, then a 'minItems' or 'maxItems' with the > same size as the list is redundant and can be dropped. Note that is DT >

Re: [PATCH] dt-bindings: arm-smmu: Fix json-schema syntax

2021-07-20 Thread Krzysztof Kozlowski
On Tue, 13 Jul 2021 at 10:27, Krzysztof Kozlowski wrote: > > On Mon, 12 Jul 2021 at 16:14, Rob Herring wrote: > > > > On Tue, Jun 22, 2021 at 11:56 PM Krzysztof Kozlowski > > wrote: > > > > > > On Mon, 21 Jun 2021 16:00:36 +0200, Thierry Reding wrote: > > > > Commit 4287861dca9d ("dt-bindings: a

Re: [Resend RFC PATCH V4 09/13] x86/Swiotlb/HV: Add Swiotlb bounce buffer remap function for HV IVM

2021-07-20 Thread Christoph Hellwig
Please split the swiotlb changes into a separate patch from the consumer. > } > + > +/* > + * hv_map_memory - map memory to extra space in the AMD SEV-SNP Isolation VM. > + */ > +unsigned long hv_map_memory(unsigned long addr, unsigned long size) > +{ > + unsigned long *pfns = kcalloc(size

[PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-20 Thread Will Deacon
Although swiotlb_exit() frees the 'slots' metadata array referenced by 'io_tlb_default_mem', it leaves the underlying buffer pages allocated despite no longer being usable. Extend swiotlb_exit() to free the buffer pages as well as the slots array. Cc: Claire Chang Cc: Christoph Hellwig Cc: Robi

[PATCH v2 3/4] swiotlb: Emit diagnostic in swiotlb_exit()

2021-07-20 Thread Will Deacon
A recent debugging session would have been made a little bit easier if we had noticed sooner that swiotlb_exit() was being called during boot. Add a simple diagnostic message to swiotlb_exit() to complement the one from swiotlb_print_info() during initialisation. Cc: Claire Chang Cc: Christoph H

[PATCH v2 2/4] swiotlb: Convert io_default_tlb_mem to static allocation

2021-07-20 Thread Will Deacon
Since commit 69031f500865 ("swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used"), 'struct device' may hold a copy of the global 'io_default_tlb_mem' pointer if the device is using swiotlb for DMA. A subsequent call to swiotlb_exit() will therefore leave dangling pointers behind in these devi

[PATCH v2 1/4] of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS

2021-07-20 Thread Will Deacon
When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV and breaks the boot for sparc[64] machines. Return 0 instead, since the function is essentially a glorified NOP in this configuration. Cc: Claire Chang Cc: Konrad Rzeszutek Wilk Reported-by: Guenter Roeck Suggested-by: Rob

[PATCH v2 0/4] Fix restricted DMA vs swiotlb_exit()

2021-07-20 Thread Will Deacon
Hi again, folks, This is version two of the patch series I posted yesterday: https://lore.kernel.org/r/20210719123054.6844-1-w...@kernel.org The only changes since v1 are: * Squash patches 2 and 3, amending the commit message accordingly * Add Reviewed-by and Tested-by tags from Christoph

Re: [Resend RFC PATCH V4 09/13] x86/Swiotlb/HV: Add Swiotlb bounce buffer remap function for HV IVM

2021-07-20 Thread Tianyu Lan
Hi Christoph & Konrad: Could you review this patch and make sure this is right way to resolve the memory remap request from AMD SEV-SNP vTOM case? Thanks. On 7/7/2021 11:46 PM, Tianyu Lan wrote: From: Tianyu Lan In Isolation VM with AMD SEV, bounce buffer needs to be accessed via extr

Re: [PATCH 4/5] iommu/vt-d: Disallow SVA if devices don't support 64-bit address

2021-07-20 Thread Robin Murphy
On 2021-07-20 02:38, Lu Baolu wrote: When the device and CPU share an address space (such as SVA), the device must support the same addressing capability as the CPU. The CPU does not consider the addressing ability of any device when managing the page table of a process, so the device must have e

Re: [PATCH 2/5] swiotlb: Point io_default_tlb_mem at static allocation

2021-07-20 Thread Will Deacon
On Tue, Jul 20, 2021 at 09:51:12AM +0200, Christoph Hellwig wrote: > I'd prefer if the next patch is merged into this one, to avoid the > confusing state inbetween entirely. Of course. For some reason, I half thought this patch would need to go to stable, but the restricted DMA stuff didn't land s

Re: [PATCH 5/5] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-20 Thread Will Deacon
On Tue, Jul 20, 2021 at 11:36:19AM +0800, Claire Chang wrote: > On Mon, Jul 19, 2021 at 8:31 PM Will Deacon wrote: > > > > Although swiotlb_exit() frees the 'slots' metadata array referenced by > > 'io_tlb_default_mem', it leaves the underlying buffer pages allocated > > despite no longer being us

Re: [PATCH 0/5] Fix restricted DMA vs swiotlb_exit()

2021-07-20 Thread Christoph Hellwig
Looks fine except for the patch split nitpick mentioned: Reviewed-by: Christoph Hellwig ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 2/5] swiotlb: Point io_default_tlb_mem at static allocation

2021-07-20 Thread Christoph Hellwig
I'd prefer if the next patch is merged into this one, to avoid the confusing state inbetween entirely. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu