Re: [PATCH] iommu: intel: remove flooding of non-error logs, when new-DMA-PTE is the same as old-DMA-PTE.

2021-10-04 Thread Alex Williamson
On Sat, 2 Oct 2021 22:48:24 +0530 Ajay Garg wrote: > Thanks Lu for the reply. > > > > > Isn't the domain should be switched from a default domain to an > > unmanaged domain when the device is assigned to the guest? > > > > Even you want to r-setup the same mappings, you need to un-map all > >

Re: [PATCH v2 0/5] iommu: Support identity mappings of reserved-memory regions

2021-10-04 Thread Dmitry Osipenko
04.10.2021 22:23, Thierry Reding пишет: > On Sun, Oct 03, 2021 at 04:09:56AM +0300, Dmitry Osipenko wrote: >> 23.04.2021 19:32, Thierry Reding пишет: >>> I've made corresponding changes in the proprietary bootloader, added a >>> compatibility shim in U-Boot (which forwards information created by

Re: [PATCH v2 0/5] iommu: Support identity mappings of reserved-memory regions

2021-10-04 Thread Thierry Reding
On Sun, Oct 03, 2021 at 04:09:56AM +0300, Dmitry Osipenko wrote: > 23.04.2021 19:32, Thierry Reding пишет: > > I've made corresponding changes in the proprietary bootloader, added a > > compatibility shim in U-Boot (which forwards information created by the > > proprietary bootloader to the

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-10-04 Thread Jason Gunthorpe via iommu
On Mon, Oct 04, 2021 at 09:40:03AM -0700, Jacob Pan wrote: > Hi Barry, > > On Sat, 2 Oct 2021 01:45:59 +1300, Barry Song <21cn...@gmail.com> wrote: > > > > > > > > I assume KVA mode can avoid this iotlb flush as the device is using > > > > the page table of the kernel and sharing the whole

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-10-04 Thread Jacob Pan
Hi Barry, On Sat, 2 Oct 2021 01:45:59 +1300, Barry Song <21cn...@gmail.com> wrote: > > > > > I assume KVA mode can avoid this iotlb flush as the device is using > > > the page table of the kernel and sharing the whole kernel space. But > > > will users be glad to accept this mode? > > > >

Re: [PATCH v3 19/20] PCI/P2PDMA: introduce pci_mmap_p2pmem()

2021-10-04 Thread Christian König via iommu
Am 04.10.21 um 15:27 schrieb Jason Gunthorpe: On Mon, Oct 04, 2021 at 03:22:22PM +0200, Christian König wrote: That use case is completely unrelated to GUP and when this doesn't work we have quite a problem. My read is that unmap_mapping_range() guarentees the physical TLB hardware is

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread Robin Murphy
On 2021-10-04 12:44, Will Deacon wrote: On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: The IOVA domain structure is a bit overloaded, holding: - IOVA tree management - FQ control - IOVA rcache memories Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c uses

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread John Garry
On 04/10/2021 12:44, Will Deacon wrote: On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: The IOVA domain structure is a bit overloaded, holding: - IOVA tree management - FQ control - IOVA rcache memories Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c uses

Re: [PATCH 5/5] iommu/iova: Avoid double-negatives in magazine helpers

2021-10-04 Thread John Garry
On 04/10/2021 12:38, Will Deacon wrote: Hi Will, To avoid this, stop using double-negatives, like !iova_magazine_full() and !iova_magazine_empty(), and use positive tests, like iova_magazine_has_space() and iova_magazine_has_pfns(), respectively; these can safely deal with cpu_rcache->{loaded,

Re: [PATCH v3 19/20] PCI/P2PDMA: introduce pci_mmap_p2pmem()

2021-10-04 Thread Jason Gunthorpe
On Mon, Oct 04, 2021 at 03:22:22PM +0200, Christian König wrote: > That use case is completely unrelated to GUP and when this doesn't work we > have quite a problem. My read is that unmap_mapping_range() guarentees the physical TLB hardware is serialized across all CPUs upon return. It also

Re: [PATCH v3 19/20] PCI/P2PDMA: introduce pci_mmap_p2pmem()

2021-10-04 Thread Christian König via iommu
Am 04.10.21 um 15:11 schrieb Jason Gunthorpe: On Mon, Oct 04, 2021 at 08:58:35AM +0200, Christian König wrote: I'm not following this discussion to closely, but try to look into it from time to time. Am 01.10.21 um 19:45 schrieb Jason Gunthorpe: On Fri, Oct 01, 2021 at 11:01:49AM -0600, Logan

Re: [PATCH v3 19/20] PCI/P2PDMA: introduce pci_mmap_p2pmem()

2021-10-04 Thread Jason Gunthorpe
On Mon, Oct 04, 2021 at 08:58:35AM +0200, Christian König wrote: > I'm not following this discussion to closely, but try to look into it from > time to time. > > Am 01.10.21 um 19:45 schrieb Jason Gunthorpe: > > On Fri, Oct 01, 2021 at 11:01:49AM -0600, Logan Gunthorpe wrote: > > > > > In

Re: [PATCH v2 2/2] iommu/arm-smmu-v3: Simplify useless instructions in arm_smmu_cmdq_build_cmd()

2021-10-04 Thread Will Deacon
On Wed, Aug 18, 2021 at 04:04:52PM +0800, Zhen Lei wrote: > Although the parameter 'cmd' is always passed by a local array variable, > and only this function modifies it, the compiler does not know this. The > compiler almost always reads the value of cmd[i] from memory rather than > directly

Re: [PATCH] iommu/arm-smmu-v3: Stop pre-zeroing batch commands in arm_smmu_atc_inv_master()

2021-10-04 Thread Will Deacon
On Tue, 17 Aug 2021 19:34:11 +0800, Zhen Lei wrote: > Pre-zeroing the batched commands structure is inefficient, as individual > commands are zeroed later in arm_smmu_cmdq_build_cmd(). Therefore, only > the member 'num' needs to be initialized to 0. > > Applied to will

Re: [PATCH v2 0/2] iommu/arm-smmu-v3: Perform some simple optimizations for arm_smmu_cmdq_build_cmd()

2021-10-04 Thread Will Deacon
On Wed, 18 Aug 2021 16:04:50 +0800, Zhen Lei wrote: > v1 --> v2: > 1. Add patch 1, Properly handle the return value of arm_smmu_cmdq_build_cmd() > 2. Remove arm_smmu_cmdq_copy_cmd(). In addition, when build command fails, > out_cmd is not filled. > > > Zhen Lei (2): > iommu/arm-smmu-v3:

Re: [PATCH 1/2] dt-bindings: arm-smmu: Add compatible for SM6350 SoC

2021-10-04 Thread Will Deacon
On Fri, 20 Aug 2021 22:29:04 +0200, Konrad Dybcio wrote: > Add the SoC specific compatible for SM6350 implementing > arm,mmu-500. > > Applied to will (for-joerg/arm-smmu/updates), thanks! [1/2] dt-bindings: arm-smmu: Add compatible for SM6350 SoC

Re: [PATCH 1/2] iommu: arm-smmu-qcom: Add compatible for qcm2290

2021-10-04 Thread Will Deacon
On Fri, 1 Oct 2021 16:00:31 +0200, Loic Poulain wrote: > Applied to will (for-joerg/arm-smmu/updates), thanks! [1/2] iommu: arm-smmu-qcom: Add compatible for qcm2290 https://git.kernel.org/will/c/756a622c8f06 [2/2] dt-bindings: arm-smmu: Add qcm2290 compatible strings

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: > The IOVA domain structure is a bit overloaded, holding: > - IOVA tree management > - FQ control > - IOVA rcache memories > > Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c > uses the FQ feature. > > This

Re: [PATCH 5/5] iommu/iova: Avoid double-negatives in magazine helpers

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:57PM +0800, John Garry wrote: > A similar crash to the following could be observed if initial CPU rcache > magazine allocations fail in init_iova_rcaches(): > > Unable to handle kernel NULL pointer dereference at virtual address > > Mem abort info:

Re: [PATCH 1/5] iova: Move fast alloc size roundup into alloc_iova_fast()

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:53PM +0800, John Garry wrote: > It really is a property of the IOVA rcache code that we need to alloc a > power-of-2 size, so relocate the functionality to resize into > alloc_iova_fast(), rather than the callsites. > > Signed-off-by: John Garry > --- >

[PATCH v2] iommu/amd: Recover from event log overflow

2021-10-04 Thread Lennert Buytenhek
The AMD IOMMU logs I/O page faults and such to a ring buffer in system memory, and this ring buffer can overflow. The AMD IOMMU spec has the following to say about the interrupt status bit that signals this overflow condition: EventOverflow: Event log overflow. RW1C. Reset 0b. 1 = IOMMU

Re: [PATCH v3 19/20] PCI/P2PDMA: introduce pci_mmap_p2pmem()

2021-10-04 Thread Christian König via iommu
I'm not following this discussion to closely, but try to look into it from time to time. Am 01.10.21 um 19:45 schrieb Jason Gunthorpe: On Fri, Oct 01, 2021 at 11:01:49AM -0600, Logan Gunthorpe wrote: In device-dax, the refcount is only used to prevent the device, and therefore the pages,