Re: [RFC v2 1/3] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-11-12 Thread Auger Eric
Hi Yi, On 11/6/19 2:31 AM, Liu, Yi L wrote: >> From: Alex Williamson [mailto:alex.william...@redhat.com] >> Sent: Wednesday, November 6, 2019 6:42 AM >> To: Liu, Yi L >> Subject: Re: [RFC v2 1/3] vfio: VFIO_IOMMU_CACHE_INVALIDATE >> >> On Fri, 25 Oct 2019 11:20:40 + >> "Liu, Yi L" wrote: >>

RE: [RFC v2 3/3] vfio/type1: bind guest pasid (guest page tables) to host

2019-11-12 Thread Liu, Yi L
> From: Alex Williamson > Sent: Wednesday, November 13, 2019 1:26 AM > To: Liu, Yi L > Subject: Re: [RFC v2 3/3] vfio/type1: bind guest pasid (guest page tables) to > host > > On Tue, 12 Nov 2019 11:21:40 + > "Liu, Yi L" wrote: > > > > From: Alex Williamson < alex.william...@redhat.com >

[PATCH 1/3] dma-direct: unify the dma_capable definitions

2019-11-12 Thread Christoph Hellwig
Currently each architectures that wants to override dma_to_phys and phys_to_dma also has to provide dma_capable. But there isn't really any good reason for that. powerpc and mips just have copies of the generic one minus the latests fix, and the arm one was the inspiration for said fix, but misse

unify the dma_capable definition

2019-11-12 Thread Christoph Hellwig
Hi all, there is no good reason to have different version of dma_capable. This series removes the arch overrides and also adds a few cleanups in the same area. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mail

[PATCH 2/3] dma-direct: avoid a forward declaration for phys_to_dma

2019-11-12 Thread Christoph Hellwig
Move dma_capable down a bit so that we don't need a forward declaration for phys_to_dma. Signed-off-by: Christoph Hellwig --- include/linux/dma-direct.h | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/include/linux/dma-direct.h b/include/linux

[PATCH 3/3] powerpc: remove support for NULL dev in __phys_to_dma / __dma_to_phys

2019-11-12 Thread Christoph Hellwig
Support for calling the DMA API functions without a valid device pointer was removed a while ago, so remove the stale support for that from the powerpc __phys_to_dma / __dma_to_phys helpers. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 4 1 file changed, 4 de

remove DMA_ATTR_WRITE_BARRIER

2019-11-12 Thread Christoph Hellwig
There is no implementation of the DMA_ATTR_WRITE_BARRIER flag left now that the ia64 sn2 code has been removed. Drop the flag and the calling convention to set it in the RDMA code. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.lin

[PATCH 1/2] dma-mapping: remove the DMA_ATTR_WRITE_BARRIER flag

2019-11-12 Thread Christoph Hellwig
This flag is not implemented by any backend and only set by the ib_umem module in a single instance. Signed-off-by: Christoph Hellwig --- Documentation/DMA-attributes.txt | 18 -- drivers/infiniband/core/umem.c | 9 ++--- include/linux/dma-mapping.h | 5 + 3 file

[PATCH 2/2] IB/umem: remove the dmasync argument to ib_umem_get

2019-11-12 Thread Christoph Hellwig
The argument is always ignored, so remove it. Signed-off-by: Christoph Hellwig --- drivers/infiniband/core/umem.c| 3 +-- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 10 - drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +- drivers/infiniband/hw/cxgb4/mem.c

[PATCH 1/3] x86: Remove the calgary IOMMU driver

2019-11-12 Thread Christoph Hellwig
The calgary IOMMU was only used on high-end IBM systems in the early x86_64 age and has no known users left. Remove it to avoid having to touch it for pending changes to the DMA API. Signed-off-by: Christoph Hellwig --- MAINTAINERS | 10 - arch/x86/Kconfig

[PATCH 2/3] x86/pci: Remove pci_64.h

2019-11-12 Thread Christoph Hellwig
This file only contains external declarations for two non-existing function pointers. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/pci.h| 4 arch/x86/include/asm/pci_64.h | 14 -- 2 files changed, 18 deletions(-) delete mode 100644 arch/x86/include/asm/pci_64.

[PATCH 3/3] x86/pci: Remove #ifdef __KERNEL__ guard from

2019-11-12 Thread Christoph Hellwig
pci.h is not a UAPI header, so the __KERNEL__ ifdef is rather pointless. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/pci.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index d9e28aad2738..90d0731fdcb6 100644 --- a/arc

Remove the calgary iommu driver

2019-11-12 Thread Christoph Hellwig
Hi all, per the discussion a few month ago with Jon we've agreed that the calgary iommu driver is obsolete and in the way. Jon said back then he'd send a patch to remove it, but as that didn't happen I prepared one, plus two small cleanups touching the same area. __

Re: [PATCH v5 02/10] iommu/vt-d: Use per-device dma_ops

2019-11-12 Thread Christoph Hellwig
On Wed, Nov 13, 2019 at 10:50:27AM +0800, Lu Baolu wrote: > Currently, this is a block issue for using per-device dma ops in Intel > IOMMU driver. Hence block this driver from using the generic iommu dma > ops. That is in fact the reason why I bring it up :) > I'd like to align Intel IOMMU driver

Re: [PATCH v5 02/10] iommu/vt-d: Use per-device dma_ops

2019-11-12 Thread Lu Baolu
Hi Christoph, On 11/12/19 3:16 PM, Christoph Hellwig wrote: On Fri, Jul 26, 2019 at 09:56:51AM +0800, Lu Baolu wrote: I think current code doesn't do the right thing. The user asks the iommu driver to use identity domain for a device, but the driver force it back to DMA domain because of the de

[PATCH AUTOSEL 4.14 010/115] iommu/io-pgtable-arm: Fix race handling in split_blk_unmap()

2019-11-12 Thread Sasha Levin
From: Robin Murphy [ Upstream commit 85c7a0f1ef624ef58173ef52ea77780257bdfe04 ] In removing the pagetable-wide lock, we gained the possibility of the vanishingly unlikely case where we have a race between two concurrent unmappers splitting the same block entry. The logic to handle this is fairly

[PATCH AUTOSEL 4.19 022/209] iommu/arm-smmu-v3: Fix unexpected CMD_SYNC timeout

2019-11-12 Thread Sasha Levin
From: Zhen Lei [ Upstream commit 0f02477d16980938a84aba8688a4e3a303306116 ] The condition break condition of: (int)(VAL - sync_idx) >= 0 in the __arm_smmu_sync_poll_msi() polling loop requires that sync_idx must be increased monotonically according to the sequence of the CMDs in the cm

[PATCH AUTOSEL 4.19 021/209] iommu/io-pgtable-arm: Fix race handling in split_blk_unmap()

2019-11-12 Thread Sasha Levin
From: Robin Murphy [ Upstream commit 85c7a0f1ef624ef58173ef52ea77780257bdfe04 ] In removing the pagetable-wide lock, we gained the possibility of the vanishingly unlikely case where we have a race between two concurrent unmappers splitting the same block entry. The logic to handle this is fairly

Re: [PATCH 1/1] iommu/amd: Fix the overwritten exclusion range with multiple IVMDs

2019-11-12 Thread Huang Adrian
On Wed, Nov 13, 2019 at 12:05 AM Joerg Roedel wrote: > > On Tue, Nov 12, 2019 at 05:32:31PM +0800, Huang Adrian wrote: > > > On Mon, Nov 11, 2019 at 11:22 PM Joerg Roedel wrote: > > > > So there are a couple of options here: > > > > > > 1) Bail out and disable the IOMMU as the BIOS screwe

Re: Bug 205201 - overflow of DMA mask and bus mask

2019-11-12 Thread Christian Zigotzky
On 12 November 2019 at 3:41 pm, Christoph Hellwig wrote: On Mon, Nov 11, 2019 at 01:22:55PM +0100, Christian Zigotzky wrote: Now, I can definitely say that this patch does not solve the issue. Do you have another patch for testing or shall I bisect? I'm still interested in the .config and dmes

Re: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Auger Eric
Hi Shameer, On 11/12/19 6:56 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Shameerali Kolothum Thodi >> Sent: 12 November 2019 14:21 >> To: 'Auger Eric' ; eric.auger@gmail.com; >> iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org; >> k..

RE: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Shameerali Kolothum Thodi
Hi Eric, > -Original Message- > From: Shameerali Kolothum Thodi > Sent: 12 November 2019 14:21 > To: 'Auger Eric' ; eric.auger@gmail.com; > iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org; > k...@vger.kernel.org; kvm...@lists.cs.columbia.edu; j...@8bytes.org; > alex.will

Re: [RFC v2 3/3] vfio/type1: bind guest pasid (guest page tables) to host

2019-11-12 Thread Alex Williamson
On Tue, 12 Nov 2019 11:21:40 + "Liu, Yi L" wrote: > > From: Alex Williamson < alex.william...@redhat.com > > > Sent: Friday, November 8, 2019 7:21 AM > > To: Liu, Yi L > > Subject: Re: [RFC v2 3/3] vfio/type1: bind guest pasid (guest page tables) > > to host > > > > On Thu, 24 Oct 2019 08:

Re: [PATCH] iommu/rockchip: Don't provoke WARN for harmless IRQs

2019-11-12 Thread Joerg Roedel
On Mon, Nov 11, 2019 at 06:55:18PM +, Robin Murphy wrote: > Although we don't generally expect IRQs to fire for a suspended IOMMU, > there are certain situations (particularly with debug options) where > we might legitimately end up with the pm_runtime_get_if_in_use() call > from rk_iommu_irq()

Re: [PATCH 1/1] iommu/amd: Fix the overwritten exclusion range with multiple IVMDs

2019-11-12 Thread Joerg Roedel
On Tue, Nov 12, 2019 at 05:32:31PM +0800, Huang Adrian wrote: > > On Mon, Nov 11, 2019 at 11:22 PM Joerg Roedel wrote: > > So there are a couple of options here: > > > > 1) Bail out and disable the IOMMU as the BIOS screwed up > > > > 2) Treat per-device exclusion ranges just as r

[PATCH v2 0/6] Raspberry Pi 4 PCIe support

2019-11-12 Thread Nicolas Saenz Julienne
This series aims at providing support for Raspberry Pi 4's PCIe controller, which is also shared with the Broadcom STB family of devices. There was a previous attempt to upstream this some years ago[1] but was blocked as most STB PCIe integrations have a sparse DMA mapping[2] which is something cu

[PATCH v2 1/6] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions

2019-11-12 Thread Nicolas Saenz Julienne
Some users need to make sure their rounding function accepts and returns 64bit long variables regardless of the architecture. Sadly roundup/rounddown_pow_two() takes and returns unsigned longs. Create a new generic 64bit variant of the function and cleanup rougue custom implementations. Signed-off

Re: Bug 205201 - overflow of DMA mask and bus mask

2019-11-12 Thread Christoph Hellwig
On Mon, Nov 11, 2019 at 01:22:55PM +0100, Christian Zigotzky wrote: > Now, I can definitely say that this patch does not solve the issue. > > Do you have another patch for testing or shall I bisect? I'm still interested in the .config and dmesg. Especially if the board is using arch/powerpc/sysde

RE: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: 12 November 2019 13:22 > To: Shameerali Kolothum Thodi ; > eric.auger@gmail.com; iommu@lists.linux-foundation.org; > linux-ker...@vger.kernel.org; k...@vger.kernel.org; > kvm...@lists.cs.columbia.edu; j...

Re: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Auger Eric
Hi Shameer, On 11/12/19 2:06 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 12 November 2019 11:29 >> To: Shameerali Kolothum Thodi ; >> eric.auger@gmail.com; iommu@lists.linux-foundation.org; >> linu

RE: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Shameerali Kolothum Thodi
Hi Eric, > -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: 12 November 2019 11:29 > To: Shameerali Kolothum Thodi ; > eric.auger@gmail.com; iommu@lists.linux-foundation.org; > linux-ker...@vger.kernel.org; k...@vger.kernel.org; > kvm...@lists.cs.columbia.ed

Re: [PATCH] iommu/rockchip: Don't provoke WARN for harmless IRQs

2019-11-12 Thread Marc Zyngier
On 2019-11-11 20:04, Robin Murphy wrote: Although we don't generally expect IRQs to fire for a suspended IOMMU, there are certain situations (particularly with debug options) where we might legitimately end up with the pm_runtime_get_if_in_use() call from rk_iommu_irq() returning 0. Since this d

Re: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Auger Eric
Hi Shameer, On 11/12/19 12:08 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: kvmarm-boun...@lists.cs.columbia.edu >> [mailto:kvmarm-boun...@lists.cs.columbia.edu] On Behalf Of Eric Auger >> Sent: 11 July 2019 14:56 >> To: eric.auger@gmail.com; eric.au.

RE: [RFC v2 3/3] vfio/type1: bind guest pasid (guest page tables) to host

2019-11-12 Thread Liu, Yi L
> From: Alex Williamson < alex.william...@redhat.com > > Sent: Friday, November 8, 2019 7:21 AM > To: Liu, Yi L > Subject: Re: [RFC v2 3/3] vfio/type1: bind guest pasid (guest page tables) to > host > > On Thu, 24 Oct 2019 08:26:23 -0400 > Liu Yi L wrote: > > > This patch adds vfio support to

RE: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Shameerali Kolothum Thodi
Hi Eric, > -Original Message- > From: kvmarm-boun...@lists.cs.columbia.edu > [mailto:kvmarm-boun...@lists.cs.columbia.edu] On Behalf Of Eric Auger > Sent: 11 July 2019 14:56 > To: eric.auger@gmail.com; eric.au...@redhat.com; > iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.

Re: [PATCH v7 11/11] iommu/vt-d: Add svm/sva invalidate function

2019-11-12 Thread Auger Eric
Hi Jacob, On 10/24/19 9:55 PM, Jacob Pan wrote: > When Shared Virtual Address (SVA) is enabled for a guest OS via > vIOMMU, we need to provide invalidation support at IOMMU API and driver > level. This patch adds Intel VT-d specific function to implement > iommu passdown invalidate API for shared

Re: [PATCH v2 0/8] iommu: Add PASID support to Arm SMMUv3

2019-11-12 Thread zhangfei
On 2019/11/8 下午11:25, Jean-Philippe Brucker wrote: This is version 2 of the series I sent a while ago [1], adding PASID support to the Arm SMMUv3 driver. Changes since v1: * Dropped the patch adding auxiliary domain support. It's an easy way to test PASID, by populating PASID contexts using

Re: [PATCH v7 04/11] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-11-12 Thread Auger Eric
Hi Jacob, On 11/8/19 11:55 PM, Jacob Pan wrote: > On Fri, 8 Nov 2019 12:30:31 +0100 > Auger Eric wrote: > >> Hi Jacob, >> >> On 10/24/19 9:54 PM, Jacob Pan wrote: >>> Make use of generic IOASID code to manage PASID allocation, >>> free, and lookup. Replace Intel specific code. >>> >>> Signed-off

Re: [PATCH v7 06/11] iommu/vt-d: Avoid duplicated code for PASID setup

2019-11-12 Thread Auger Eric
Hi Jacob, On 10/24/19 9:54 PM, Jacob Pan wrote: > After each setup for PASID entry, related translation caches must be flushed. > We can combine duplicated code into one function which is less error prone. > > Signed-off-by: Jacob Pan > --- > drivers/iommu/intel-pasid.c | 48 >

Re: [PATCH 1/1] iommu/amd: Fix the overwritten exclusion range with multiple IVMDs

2019-11-12 Thread Huang Adrian
Hi Joerg, > On Mon, Nov 11, 2019 at 11:22 PM Joerg Roedel wrote: > > Hi Adrian, > > On Mon, Nov 04, 2019 at 01:58:52PM +0800, Adrian Huang wrote: > > 2) When set_device_exclusion_range() parses the IVMD of devce id > > '4200', the exclusion range of the amd_iommu struct becomes: >