RE: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread zhukeqian
Hi, Cheers for these discussion. :) I am on vacation, and will come back at 2.18. Thanks, Keqian On 21-02-07 18:40:36, Keqian Zhu wrote: > Hi Yi, > > On 2021/2/7 17:56, Yi Sun wrote: > > Hi, > > > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > > > [...] > > > >> +static void vfio_dma_dirty_log_s

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Jason Gunthorpe [mailto:j...@ziepe.ca] > Sent: Wednesday, February 10, 2021 2:54 AM > To: Song Bao Hua (Barry Song) > Cc: David Hildenbrand ; Wangzhou (B) > ; linux-ker...@vger.kernel.org; > iommu@lists.linux-foundation.org; linux...@kvack.org; > linux-arm-k

Re: preserve DMA offsets when using swiotlb v2

2021-02-09 Thread Jianxiong Gao via iommu
> Sorry for being a little pushy, any chance we could get this reviewed > in time for the 5.12 merge window? > Tested and it looks good. Thanks for clearing it up! Gao ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Christoph Hellwig
On Tue, Feb 09, 2021 at 12:45:11PM +, Robin Murphy wrote: > It's not a bug, it's a fundamental design failure. dma_get_sgtable() has > only ever sort-of-worked for DMA buffers that come from CMA or regular page > allocations. In particular, a "no-map" DMA pool is not backed by kernel > memor

Re: add a new dma_alloc_noncontiguous API v2

2021-02-09 Thread Ricardo Ribalda
Hi Christoph I have tested it in both arm and x86, since there are not significant changes with the previous version I did not do a performance test. Thanks! On Tue, Feb 9, 2021 at 9:29 AM Ricardo Ribalda wrote: > > Hi Christoph > > On Tue, Feb 9, 2021 at 9:22 AM Christoph Hellwig wrote: > >

DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Sumit Garg
Hi Christoph, Greg, Currently we are observing an incorrect address translation corresponding to DMA direct mapping methods on 5.4 stable kernel while sharing dmabuf from one device to another where both devices have their own coherent DMA memory pools. I am able to root cause this issue which is

RE: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread obayashi.yoshimasa
> How do you judge "mature"? My basic criteria are * Function is exist, but bug fix is necessary: "mature" * Function extension is necessary: "immature" > And again, if a feature isn't present in a specific kernel version, why would > you think that it would be > a viable solution for you to u

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Sumit Garg
Hi Christoph, On Tue, 9 Feb 2021 at 15:06, Christoph Hellwig wrote: > > On Tue, Feb 09, 2021 at 10:23:12AM +0100, Greg KH wrote: > > > From the view point of ZeroCopy using DMABUF, is 5.4 not > > > mature enough, and is 5.10 enough mature ? > > > This is the most important point for judging m

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Jason Gunthorpe
On Tue, Feb 09, 2021 at 03:01:42AM +, Song Bao Hua (Barry Song) wrote: > On the other hand, wouldn't it be the benefit of hardware accelerators > to have a lower and more stable latency zip/encryption than CPU? No, I don't think so. If this is an important problem then it should apply equall

Re: [PATCH 5/6] driver core: lift dma_default_coherent into common code

2021-02-09 Thread Thomas Bogendoerfer
On Mon, Feb 08, 2021 at 03:50:23PM +0100, Christoph Hellwig wrote: > Lift the dma_default_coherent variable from the mips architecture code > to the driver core. This allows an architecture to sdefault all device > to be DMA coherent at run time, even if the kernel is build with support > for DMA

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Robin Murphy
On 2021-02-09 12:36, Sumit Garg wrote: Hi Christoph, On Tue, 9 Feb 2021 at 15:06, Christoph Hellwig wrote: On Tue, Feb 09, 2021 at 10:23:12AM +0100, Greg KH wrote: From the view point of ZeroCopy using DMABUF, is 5.4 not mature enough, and is 5.10 enough mature ? This is the most impor

[PATCH] iommu: Add device name to iommu map/unmap trace events

2021-02-09 Thread Sai Prakash Ranjan
IOMMU map/unmap traces become hard to decode i.e., it becomes hard to associate the map/unmap events with the particular device from the iova/paddr/size parameters alone when there are multiple devices attached. So it is useful to add the device name to iommu trace events which can be used to filte

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/9 20:01, Greg KH wrote: > On Tue, Feb 09, 2021 at 07:58:15PM +0800, Zhou Wang wrote: >> On 2021/2/9 17:37, Greg KH wrote: >>> On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: On 2021/2/8 6:02, Andy Lutomirski wrote: > > >> On Feb 7, 2021, at 12:31 AM, Zhou Wang

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Robin Murphy
On 2021-02-09 11:57, Yi Sun wrote: On 21-02-07 18:40:36, Keqian Zhu wrote: Hi Yi, On 2021/2/7 17:56, Yi Sun wrote: Hi, On 21-01-28 23:17:41, Keqian Zhu wrote: [...] +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, +struct vfio_dma *dma) +{

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Yi Sun
On 21-02-09 11:16:08, Robin Murphy wrote: > On 2021-02-07 09:56, Yi Sun wrote: > >Hi, > > > >On 21-01-28 23:17:41, Keqian Zhu wrote: > > > >[...] > > > >>+static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, > >>+struct vfio_dma *dma) > >>+{ > >>+ struct

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Yi Sun
On 21-02-07 18:40:36, Keqian Zhu wrote: > Hi Yi, > > On 2021/2/7 17:56, Yi Sun wrote: > > Hi, > > > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > > > [...] > > > >> +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, > >> + struct vfio_dma *dma) > >> +{

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 07:58:15PM +0800, Zhou Wang wrote: > On 2021/2/9 17:37, Greg KH wrote: > > On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: > >> On 2021/2/8 6:02, Andy Lutomirski wrote: > >>> > >>> > On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: > > SVA(share virt

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/9 17:37, Greg KH wrote: > On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: >> On 2021/2/8 6:02, Andy Lutomirski wrote: >>> >>> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: SVA(share virtual address) offers a way for device to share process virtual ad

Re: [PATCH 5/6] driver core: lift dma_default_coherent into common code

2021-02-09 Thread Maciej W. Rozycki
On Mon, 8 Feb 2021, Christoph Hellwig wrote: > > Do you need to have this verified anyhow? I only have a non-coherent 5Kc > > Malta though. > > If you get a chance to test this logic, that would be great. I'll try to give it a hit in the next few days then. Installed in my Malta I have a D

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Robin Murphy
On 2021-02-07 09:56, Yi Sun wrote: Hi, On 21-01-28 23:17:41, Keqian Zhu wrote: [...] +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, +struct vfio_dma *dma) +{ + struct vfio_domain *d; + + list_for_each_entry(d, &iommu->domain_lis

AW: [PATCH][next] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-09 Thread Walter Harms
I second that ... Having i unsigned violates the rule of "least surprise". If you need it unsigned make it clearly visible, also adding a simple comment may help. jm2c, wh Von: Dan Carpenter Gesendet: Dienstag, 9. Februar 2021 10:19:23 An: Will Deacon Cc

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 10:19:07AM +, obayashi.yoshim...@socionext.com wrote: > > How do you judge "mature"? > > My basic criteria are > * Function is exist, but bug fix is necessary: "mature" > * Function extension is necessary: "immature" > > > And again, if a feature isn't present in a

Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path

2021-02-09 Thread Christoph Hellwig
On Mon, Feb 08, 2021 at 12:14:49PM -0500, Konrad Rzeszutek Wilk wrote: > > ring buffer or whatever because you know I/O will be copied anyway > > and none of all the hard work higher layers do to make the I/O suitable > > for a normal device apply. > > I lost you here. Sorry, are you saying have a

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: > On 2021/2/8 6:02, Andy Lutomirski wrote: > > > > > >> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: > >> > >> SVA(share virtual address) offers a way for device to share process > >> virtual > >> address space safely, which makes mor

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Christoph Hellwig
On Tue, Feb 09, 2021 at 10:23:12AM +0100, Greg KH wrote: > > From the view point of ZeroCopy using DMABUF, is 5.4 not > > mature enough, and is 5.10 enough mature ? > > This is the most important point for judging migration. > > How do you judge "mature"? > > And again, if a feature isn't pr

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/8 5:51, Arnd Bergmann wrote: > On Sun, Feb 7, 2021 at 9:18 AM Zhou Wang wrote: > >> diff --git a/arch/arm64/include/asm/unistd32.h >> b/arch/arm64/include/asm/unistd32.h >> index cccfbbe..3f49529 100644 >> --- a/arch/arm64/include/asm/unistd32.h >> +++ b/arch/arm64/include/asm/unistd32

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 09:05:40AM +, obayashi.yoshim...@socionext.com wrote: > > > As the drivers are currently under development and Socionext has > > > chosen 5.4 stable kernel for their development. So I will let > > > Obayashi-san answer this if it's possible for them to migrate to 5.10 >

Re: [PATCH][next] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-09 Thread Dan Carpenter
On Thu, Feb 04, 2021 at 09:25:58AM +, Will Deacon wrote: > On Wed, Feb 03, 2021 at 01:59:36PM +, Colin King wrote: > > From: Colin Ian King > > > > Currently the check for domid < 0 is always false because domid > > is unsigned. Fix this by making it signed. > > > > Addresses-CoverityL

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/8 6:02, Andy Lutomirski wrote: > > >> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: >> >> SVA(share virtual address) offers a way for device to share process virtual >> address space safely, which makes more convenient for user space device >> driver coding. However, IO page faults ma

Re: DMA direct mapping fix for 5.4 and earlier stable branches

2021-02-09 Thread Greg Kroah-Hartman
On Tue, Feb 09, 2021 at 01:28:47PM +0530, Sumit Garg wrote: > Thanks Greg for your response. > > On Tue, 9 Feb 2021 at 12:28, Greg Kroah-Hartman > wrote: > > > > On Tue, Feb 09, 2021 at 11:39:25AM +0530, Sumit Garg wrote: > > > Hi Christoph, Greg, > > > > > > Currently we are observing an incorre

Re: preserve DMA offsets when using swiotlb v2

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 09:41:56AM +0100, Christoph Hellwig wrote: > Sorry for being a little pushy, any chance we could get this reviewed > in time for the 5.12 merge window? No objection from me, my ack is already on the patch that you need it for :) thanks, greg k-h __

Re: add a new dma_alloc_noncontiguous API v2

2021-02-09 Thread Ricardo Ribalda
Hi Christoph On Tue, Feb 9, 2021 at 9:22 AM Christoph Hellwig wrote: > > On Mon, Feb 08, 2021 at 08:33:50PM +0900, Tomasz Figa wrote: > > Sorry for the delay. The whole series looks very good to me. Thanks a lot. > > > > Reviewed-by: Tomasz Figa > > Thanks. > > Ricardo, do the uvcvideo changes l