Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-01-23 Thread Joerg Roedel
Hi Jean-Philippe, thanks for all your hard work on this! On Tue, Jan 15, 2019 at 12:19:52PM +, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.9 [1]. To make progress on this I think the spec needs to be close to something that can be included

[PATCH 4/5] virtio: Introduce virtio_max_dma_size()

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel This function returns the maximum segment size for a single dma transaction of a virtio device. The possible limit comes from the SWIOTLB implementation in the Linux kernel, that has an upper limit of (currently) 256kb of contiguous memory it can map. Other DMA-API

[PATCH 1/5] swiotlb: Introduce swiotlb_max_mapping_size()

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel The function returns the maximum size that can be remapped by the SWIOTLB implementation. This function will be later exposed to users through the DMA-API. Signed-off-by: Joerg Roedel --- include/linux/swiotlb.h | 5 + kernel/dma/swiotlb.c| 5 + 2 files changed,

[PATCH 2/5] swiotlb: Add is_swiotlb_active() function

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel This function will be used from dma_direct code to determine the maximum segment size of a dma mapping. Signed-off-by: Joerg Roedel --- include/linux/swiotlb.h | 6 ++ kernel/dma/swiotlb.c| 5 + 2 files changed, 11 insertions(+) diff --git

Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-23 Thread Joonas Lahtinen
Quoting Joerg Roedel (2019-01-22 18:51:35) > On Tue, Jan 22, 2019 at 04:48:26PM +0200, Joonas Lahtinen wrote: > > According to our IOMMU folks there exists some desire to be able to assign > > the iGFX device aka have intel_iommu=on instead of intel_iommu=igfx_off > > due to how the devices might

[PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA mapping size supported on the platform. Take that into account when setting the maximum segment size for a block device. Signed-off-by: Joerg Roedel --- drivers/block/virtio_blk.c | 10 ++ 1 file changed, 6

[PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Joerg Roedel
Hi, here is the third version of this patch-set. Previous versions can be found here: V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ V2: https://lore.kernel.org/lkml/20190115132257.6426-1-j...@8bytes.org/ The problem solved here is a limitation of the

[PATCH 3/5] dma: Introduce dma_max_mapping_size()

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel The function returns the maximum size that can be mapped using DMA-API functions. The patch also adds the implementation for direct DMA and a new dma_map_ops pointer so that other implementations can expose their limit. Signed-off-by: Joerg Roedel ---

Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-23 Thread Joerg Roedel
On Wed, Jan 23, 2019 at 05:02:38PM +0200, Joonas Lahtinen wrote: > We have many reports where just having intel_iommu=on (and using the > system normally, without any virtualization stuff going on) will cause > unexplained GPU hangs. For those users, simply switching to > intel_iommu=igfx_off

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > Hi, > > here is the third version of this patch-set. Previous > versions can be found here: > > V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ > > V2:

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > Hi, > > here is the third version of this patch-set. Previous > versions can be found here: > > V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ > > V2:

Re: [PATCH 2/5] swiotlb: Add is_swiotlb_active() function

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:46PM +0100, Joerg Roedel wrote: > +bool is_swiotlb_active(void) > +{ > + return !no_iotlb_memory; > +} As I've just introduced and fixed a bug in this area in the current cycle - I don't think no_iotlb_memory is what your want (and maybe not useful at all): if

Re: [PATCH 1/5] swiotlb: Introduce swiotlb_max_mapping_size()

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:45PM +0100, Joerg Roedel wrote: > +extern size_t swiotlb_max_mapping_size(struct device *dev); No need for the extern keyword on function declarations in headers. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH 3/5] dma: Introduce dma_max_mapping_size()

2019-01-23 Thread Christoph Hellwig
This looks ok, but could really use some documentation in Documentation/DMA-API.txt. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 23, 2019 at 01:51:29PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > > Hi, > > > > here is the third version of this patch-set. Previous > > versions can be found here: > > > > V1:

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > + max_size = virtio_max_dma_size(vdev); > + > /* Host can optionally specify maximum segment size and number of >* segments. */ > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, >

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 10:31:39PM +0100, Christoph Hellwig wrote: > On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > > + max_size = virtio_max_dma_size(vdev); > > + > > /* Host can optionally specify maximum segment size and number of > > * segments. */ > > err =

Re: [PATCH] iommu/mediatek: Use correct fwspec in mtk_iommu_add_device()

2019-01-23 Thread Frank Wunderlich
Tested-by: Frank Wunderlich ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: use generic DMA mapping code in powerpc V4

2019-01-23 Thread Christian Zigotzky
Hi Christoph, I also compiled a kernel (zImage) for the X1000  from your Git 'powerpc-dma.6-debug' (both patches) today. It boots and the P.A. Semi Ethernet works! I will test just the first patch tomorrow. Thanks, Christian On 21 January 2019 at 3:38PM, Christian Zigotzky wrote: Hello

Re: [PATCH] iommu/amd: Fix IOMMU page flush when detach all devices from a domain

2019-01-23 Thread Suthikulpanit, Suravee
Joerg, On 1/23/19 2:56 PM, j...@8bytes.org wrote: > Hi Suravee, > > On Tue, Jan 22, 2019 at 03:53:18PM +, Suthikulpanit, Suravee wrote: >> Thanks for the detail. Alright then, let's just go with the version you >> sent on 1/16/19. Do you want me to resend V3 with that changes, or >> would

[PATCH 1/1] iommu/vt-d: Leave scalable mode default off

2019-01-23 Thread Lu Baolu
Commit 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable mode capability") enables VT-d scalable mode if hardware advertises the capability. As we will bring up different features and use cases to upstream in different patch series, it will leave some intermediate kernel versions which support

[PATCH v3] iommu: amd: Fix IOMMU page flush when detach device from a domain

2019-01-23 Thread Suthikulpanit, Suravee
From: Suravee Suthikulpanit When a VM is terminated, the VFIO driver detaches all pass-through devices from VFIO domain by clearing domain id and page table root pointer from each device table entry (DTE), and then invalidates the DTE. Then, the VFIO driver unmap pages and invalidate IOMMU

Re: [PATCH 0/3] iommu/arm-smmu: Add support to use Last level cache

2019-01-23 Thread Vivek Gautam
On Mon, Jan 21, 2019 at 7:55 PM Ard Biesheuvel wrote: > > On Mon, 21 Jan 2019 at 14:56, Robin Murphy wrote: > > > > On 21/01/2019 13:36, Ard Biesheuvel wrote: > > > On Mon, 21 Jan 2019 at 14:25, Robin Murphy wrote: > > >> > > >> On 21/01/2019 10:50, Ard Biesheuvel wrote: > > >>> On Mon, 21 Jan

Re: [PATCH v5 2/8] iommu/vt-d: Add per-device IOMMU feature ops entries

2019-01-23 Thread Lu Baolu
Hi Joerg, On 1/11/19 7:16 PM, Joerg Roedel wrote: + +static bool +intel_iommu_dev_has_feat(struct device *dev, enum iommu_dev_features feat) +{ + struct device_domain_info *info = dev->archdata.iommu; + + if (feat == IOMMU_DEV_FEAT_AUX) + return scalable_mode_support()

[PATCH] iommu/dma: Remove unused variable

2019-01-23 Thread Shaokun Zhang
end_pfn is never used after commit ('iommu/iova: Make dma 32bit pfn implicit'), cleanup it. Cc: Joerg Roedel Cc: Robin Murphy Cc: Zhen Lei Signed-off-by: Shaokun Zhang --- drivers/iommu/dma-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: [PATCH 0/3] iommu/arm-smmu: Add support to use Last level cache

2019-01-23 Thread Ard Biesheuvel
On Thu, 24 Jan 2019 at 07:58, Vivek Gautam wrote: > > On Mon, Jan 21, 2019 at 7:55 PM Ard Biesheuvel > wrote: > > > > On Mon, 21 Jan 2019 at 14:56, Robin Murphy wrote: > > > > > > On 21/01/2019 13:36, Ard Biesheuvel wrote: > > > > On Mon, 21 Jan 2019 at 14:25, Robin Murphy wrote: > > > >> > >

Re: [PATCH 0/3] Add IPROC PCIe new features

2019-01-23 Thread Srinath Mannam via iommu
Hi Bjorn, Thank you for the review. I will address your comments in the next patchset. Regards, Srinath. On Fri, Jan 18, 2019 at 8:11 PM Bjorn Helgaas wrote: > > On Fri, Jan 18, 2019 at 09:53:20AM +0530, Srinath Mannam wrote: > > Add changes related to IPROC PCIe RC IP new features. > > > >