Re: [PATCH 1/1] iommu/vt-d: Handle memory shortage on pasid table allocation

2018-09-06 Thread Lu Baolu
Hi Ashok, On 09/07/2018 07:13 AM, Raj, Ashok wrote: On Sat, Sep 01, 2018 at 02:24:16PM +0800, Lu Baolu wrote: Pasid table memory allocation could return failure due to memory shortage. Limit the pasid table size to 1MiB because current 8MiB contiguous physical memory allocation can be hard to

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-06 Thread Kenneth Lee
On Thu, Sep 06, 2018 at 09:31:33AM -0400, Jerome Glisse wrote: > Date: Thu, 6 Sep 2018 09:31:33 -0400 > From: Jerome Glisse > To: Kenneth Lee > CC: Alex Williamson , Kenneth Lee > , Jonathan Corbet , Herbert Xu > , "David S . Miller" , > Joerg Roedel , Hao Fang , Zhou Wang > , Zaibo Xu ,

Re: [PATCH v2 06/12] iommu/vt-d: Add second level page table interface

2018-09-06 Thread Lu Baolu
Hi, On 09/06/2018 11:11 AM, Tian, Kevin wrote: From: Lu Baolu [mailto:baolu...@linux.intel.com] Sent: Thursday, August 30, 2018 9:35 AM This adds the interfaces to setup or tear down the structures for second level page table translations. This includes types of second level only translation

Re: [PATCH 1/7] vfio/sdmdev: Add documents for WarpDrive framework

2018-09-06 Thread Kenneth Lee
On Thu, Sep 06, 2018 at 11:36:36AM -0700, Randy Dunlap wrote: > Date: Thu, 6 Sep 2018 11:36:36 -0700 > From: Randy Dunlap > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > ,

Re: [PATCH v2 08/12] iommu/vt-d: Pass pasid table to context mapping

2018-09-06 Thread Lu Baolu
Hi, On 09/06/2018 11:17 AM, Tian, Kevin wrote: From: Lu Baolu [mailto:baolu...@linux.intel.com] Sent: Thursday, August 30, 2018 9:35 AM So that the pasid related info, such as the pasid table and the maximum of pasid could be used during setting up scalable mode context. Cc: Ashok Raj Cc:

Re: [PATCH v2 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support

2018-09-06 Thread Lu Baolu
Hi, On 09/06/2018 10:39 AM, Tian, Kevin wrote: From: Lu Baolu [mailto:baolu...@linux.intel.com] Sent: Thursday, August 30, 2018 9:35 AM Intel vt-d spec rev3.0 requires software to use 256-bit descriptors in invalidation queue. As the spec reads in section 6.5.2: Remapping hardware supporting

Re: [PATCH v2 02/12] iommu/vt-d: Manage scalalble mode PASID tables

2018-09-06 Thread Lu Baolu
Hi, On 09/07/2018 07:43 AM, Jacob Pan wrote: On Thu, 6 Sep 2018 10:46:03 +0800 Lu Baolu wrote: @@ -224,7 +271,14 @@ struct pasid_entry *intel_pasid_get_entry(struct device *dev, int pasid) */ static inline void pasid_clear_entry(struct pasid_entry *pe) { - WRITE_ONCE(pe->val,

[PATCH resend] iommu/ipmmu-vmsa: convert to SPDX identifiers

2018-09-06 Thread Kuninori Morimoto
From: Kuninori Morimoto This patch updates license to use SPDX-License-Identifier instead of verbose license text. Signed-off-by: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman --- - 2weeks passed. I resend this patch again drivers/iommu/ipmmu-vmsa.c | 5

Re: [PATCH v2 02/12] iommu/vt-d: Manage scalalble mode PASID tables

2018-09-06 Thread Jacob Pan
On Thu, 6 Sep 2018 10:46:03 +0800 Lu Baolu wrote: > >> @@ -224,7 +271,14 @@ struct pasid_entry > >> *intel_pasid_get_entry(struct device *dev, int pasid) > >>*/ > >> static inline void pasid_clear_entry(struct pasid_entry *pe) > >> { > >> - WRITE_ONCE(pe->val, 0); > >> +

Re: [PATCH 1/1] iommu/vt-d: Handle memory shortage on pasid table allocation

2018-09-06 Thread Raj, Ashok
On Sat, Sep 01, 2018 at 02:24:16PM +0800, Lu Baolu wrote: > Pasid table memory allocation could return failure due to memory > shortage. Limit the pasid table size to 1MiB because current 8MiB > contiguous physical memory allocation can be hard to come by. W/o > a PASID table, the device could

Re: [PATCH 1/7] vfio/sdmdev: Add documents for WarpDrive framework

2018-09-06 Thread Randy Dunlap
Hi, On 09/02/2018 05:51 PM, Kenneth Lee wrote: > From: Kenneth Lee > > WarpDrive is a common user space accelerator framework. Its main component > in Kernel is called sdmdev, Share Domain Mediated Device. It exposes > the hardware capabilities to the user space via vfio-mdev. So processes in

Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces

2018-09-06 Thread Jean-Philippe Brucker
On 05/09/2018 19:18, Jacob Pan wrote: > On Wed, 5 Sep 2018 14:14:12 +0200 > Auger Eric wrote: > >>> + * >>> + * On Arm and AMD IOMMUs, entry 0 of the PASID table can be used >>> to hold >>> + * non-PASID translations. In this case PASID 0 is reserved and >>> entry 0 points >>> + * to the

Re: [PATCH v5 13/23] iommu: introduce device fault report API

2018-09-06 Thread Jean-Philippe Brucker
On 06/09/2018 14:14, Auger Eric wrote: > Hi Jean-Philippe, > > On 09/06/2018 02:42 PM, Jean-Philippe Brucker wrote: >> On 06/09/2018 10:25, Auger Eric wrote: + mutex_lock(>lock); + list_add_tail(_pending->list, >faults); >>> same doubt as Yi Liu. You cannot rely on the

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-06 Thread Jerome Glisse
On Thu, Sep 06, 2018 at 05:45:32PM +0800, Kenneth Lee wrote: > On Tue, Sep 04, 2018 at 10:15:09AM -0600, Alex Williamson wrote: > > Date: Tue, 4 Sep 2018 10:15:09 -0600 > > From: Alex Williamson > > To: Jerome Glisse > > CC: Kenneth Lee , Jonathan Corbet , > > Herbert Xu , "David S . Miller" >

Re: [PATCH v5 13/23] iommu: introduce device fault report API

2018-09-06 Thread Auger Eric
Hi Jean-Philippe, On 09/06/2018 02:42 PM, Jean-Philippe Brucker wrote: > On 06/09/2018 10:25, Auger Eric wrote: >>> + mutex_lock(>lock); >>> + list_add_tail(_pending->list, >faults); >> same doubt as Yi Liu. You cannot rely on the userspace willingness to >> void the queue and

Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API

2018-09-06 Thread Jean-Philippe Brucker
On 06/09/2018 12:12, Christian König wrote: > Am 06.09.2018 um 13:09 schrieb Jean-Philippe Brucker: >> Hi Eric, >> >> Thanks for reviewing >> >> On 05/09/2018 12:29, Auger Eric wrote: +int iommu_sva_device_init(struct device *dev, unsigned long features, +  unsigned int

Re: [PATCH v5 13/23] iommu: introduce device fault report API

2018-09-06 Thread Jean-Philippe Brucker
On 06/09/2018 10:25, Auger Eric wrote: >> +mutex_lock(>lock); >> +list_add_tail(_pending->list, >faults); > same doubt as Yi Liu. You cannot rely on the userspace willingness to > void the queue and deallocate this memory. > > SMMUv3 holds a queue of events whose size is

Re: [PATCH v3] of/platform: initialise AMBA default DMA masks

2018-09-06 Thread Robin Murphy
On 31/08/18 15:13, Linus Walleij wrote: This addresses a v4.19-rc1 regression in the PL111 DRM driver in drivers/gpu/pl111/* The driver uses the CMA KMS helpers and will thus at some point call down to dma_alloc_attrs() to allocate a chunk of contigous DMA memory for the framebuffer. It

Re: [PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops

2018-09-06 Thread Robin Murphy
On 27/08/18 09:47, Christoph Hellwig wrote: There is no reason to leave the per-device dma_ops around when deconfiguring a device, so move this code from arm64 into the common code. Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig --- arch/arm64/include/asm/dma-mapping.h | 5

Re: [PATCH 3/4] dma-mapping: remove dma_deconfigure

2018-09-06 Thread Robin Murphy
On 27/08/18 09:47, Christoph Hellwig wrote: This goes through a lot of hooks just to call arch_teardown_dma_ops. Replace it with a direct call instead. Agreed. We originally had the deconfigure() hooks for symmetry in case there might need to be some firmware-specific state to tear down, but

Re: [PATCH 2/4] dma-mapping: remove dma_configure

2018-09-06 Thread Robin Murphy
On 27/08/18 09:47, Christoph Hellwig wrote: There is no good reason for this indirection given that the method always exists. And indeed with the way it works these days we don't really want dma_configure() to look like something which can be called from anywhere. Reviewed-by: Robin Murphy

Re: [PATCH 1/4] arm-nommu: don't define arch_teardown_dma_ops

2018-09-06 Thread Robin Murphy
On 27/08/18 09:47, Christoph Hellwig wrote: We can just use the default implementation. Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/dma-mapping.h | 2 ++ arch/arm/mm/dma-mapping-nommu.c| 4 2 files changed, 2 insertions(+), 4

Re: [PATCH] iommu/io-pgtable-arm: Fix race handling in split_blk_unmap()

2018-09-06 Thread Robin Murphy
On 06/09/18 11:05, Will Deacon wrote: Hi Robin, On Thu, Aug 23, 2018 at 01:14:59PM +0100, Robin Murphy wrote: 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.

Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API

2018-09-06 Thread Christian König
Am 06.09.2018 um 13:09 schrieb Jean-Philippe Brucker: Hi Eric, Thanks for reviewing On 05/09/2018 12:29, Auger Eric wrote: +int iommu_sva_device_init(struct device *dev, unsigned long features, + unsigned int max_pasid) what about min_pasid? No one asked for it...

Re: [PATCH v2 04/40] iommu/sva: Add a mm_exit callback for device drivers

2018-09-06 Thread Jean-Philippe Brucker
On 05/09/2018 14:23, Auger Eric wrote: >> + * If the driver intends to share process address spaces, it should pass a >> valid >> + * @mm_exit handler. Otherwise @mm_exit can be NULL. > I don't get case where mm_exit is allowed to be NULL. Right, this comment is a bit premature. Next version

Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces

2018-09-06 Thread Jean-Philippe Brucker
On 05/09/2018 13:14, Auger Eric wrote: >> +static struct io_mm * >> +io_mm_alloc(struct iommu_domain *domain, struct device *dev, >> +struct mm_struct *mm, unsigned long flags) >> +{ >> +int ret; >> +int pasid; >> +struct io_mm *io_mm; >> +struct iommu_sva_param *param =

Re: [PATCH v2 02/40] iommu/sva: Bind process address spaces to devices

2018-09-06 Thread Jean-Philippe Brucker
On 05/09/2018 12:29, Auger Eric wrote: >> +/** >> + * iommu_sva_bind_device() - Bind a process address space to a device >> + * @dev: the device >> + * @mm: the mm to bind, caller must hold a reference to it >> + * @pasid: valid address where the PASID will be stored >> + * @flags: bond properties

Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API

2018-09-06 Thread Jean-Philippe Brucker
Hi Eric, Thanks for reviewing On 05/09/2018 12:29, Auger Eric wrote: >> +int iommu_sva_device_init(struct device *dev, unsigned long features, >> + unsigned int max_pasid) > what about min_pasid? No one asked for it... The max_pasid parameter is here for drivers that have

Re: [PATCH] iommu/io-pgtable-arm: Fix race handling in split_blk_unmap()

2018-09-06 Thread Will Deacon
Hi Robin, On Thu, Aug 23, 2018 at 01:14:59PM +0100, Robin Murphy wrote: > 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: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-06 Thread Kenneth Lee
On Tue, Sep 04, 2018 at 10:15:09AM -0600, Alex Williamson wrote: > Date: Tue, 4 Sep 2018 10:15:09 -0600 > From: Alex Williamson > To: Jerome Glisse > CC: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Kenneth Lee > , Hao Fang , Zhou Wang > , Zaibo Xu ,

Re: [PATCH v5 13/23] iommu: introduce device fault report API

2018-09-06 Thread Auger Eric
Hi Jacob, On 05/11/2018 10:54 PM, Jacob Pan wrote: > Traditionally, device specific faults are detected and handled within > their own device drivers. When IOMMU is enabled, faults such as DMA > related transactions are detected by IOMMU. There is no generic > reporting mechanism to report faults

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-06 Thread Kenneth Lee
On Mon, Sep 03, 2018 at 10:32:16AM +0800, Lu Baolu wrote: > Date: Mon, 3 Sep 2018 10:32:16 +0800 > From: Lu Baolu > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > , Philippe

Re: [PATCH 7/7] vfio/sdmdev: add user sample

2018-09-06 Thread Kenneth Lee
On Sun, Sep 02, 2018 at 07:25:12PM -0700, Randy Dunlap wrote: > Date: Sun, 2 Sep 2018 19:25:12 -0700 > From: Randy Dunlap > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > ,

Re: [PATCH 6/7] crypto: add sdmdev support to Hisilicon QM

2018-09-06 Thread Kenneth Lee
On Sun, Sep 02, 2018 at 07:19:03PM -0700, Randy Dunlap wrote: > Date: Sun, 2 Sep 2018 19:19:03 -0700 > From: Randy Dunlap > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > ,

Re: [PATCH 4/7] crypto: add hisilicon Queue Manager driver

2018-09-06 Thread Kenneth Lee
On Sun, Sep 02, 2018 at 07:15:07PM -0700, Randy Dunlap wrote: > Date: Sun, 2 Sep 2018 19:15:07 -0700 > From: Randy Dunlap > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > ,

Re: [PATCH 3/7] vfio: add sdmdev support

2018-09-06 Thread Kenneth Lee
On Mon, Sep 03, 2018 at 10:55:57AM +0800, Lu Baolu wrote: > Date: Mon, 3 Sep 2018 10:55:57 +0800 > From: Lu Baolu > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > , Philippe

Re: [PATCH 3/7] vfio: add sdmdev support

2018-09-06 Thread Kenneth Lee
On Sun, Sep 02, 2018 at 07:11:12PM -0700, Randy Dunlap wrote: > Date: Sun, 2 Sep 2018 19:11:12 -0700 > From: Randy Dunlap > To: Kenneth Lee , Jonathan Corbet , > Herbert Xu , "David S . Miller" > , Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > ,

Re: [PATCH v8 4/8] media: platform: Add Cedrus VPU decoder driver

2018-09-06 Thread Hans Verkuil
On 09/06/2018 09:25 AM, Tomasz Figa wrote: > On Thu, Sep 6, 2018 at 4:01 PM Hans Verkuil wrote: >> >> On 09/05/2018 06:29 PM, Paul Kocialkowski wrote: >>> Hi and thanks for the review! >>> >>> Le lundi 03 septembre 2018 à 11:11 +0200, Hans Verkuil a écrit : On 08/28/2018 09:34 AM, Paul

Re: [PATCH v2 13/40] vfio: Add support for Shared Virtual Addressing

2018-09-06 Thread Xu Zaibo
On 2018/9/5 19:02, Jean-Philippe Brucker wrote: On 05/09/2018 04:15, Xu Zaibo wrote: 1. While the series are finished well, VFIO-PCI device can be held by only one process through binding IOCTL command without PASID (without PASID being exposed user space). It could, but