Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-21 Thread Roman Skakun
a sufficiently large buffer which is greater than 256 KB (128(CURRENT_IO_TLB_SEGMENT * 2048) and need to adjust this parameter during boot time, not compilation time. In order to this point, this patch was created. Thanks, Roman пт, 17 сент. 2021 г. в 12:44, Robin Murphy : > > On 2021-09-17 10

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-17 Thread Roman Skakun
> extra replacement, nor would a test build (with both patches in > place). It's reasonable. I will change the original IO_TLB_SEGSIZE to IO_TLB_DEFAULT_SEGSIZE in the next patch series. Thanks. ср, 15 сент. 2021 г. в 16:50, Jan Beulich : > > On 15.09.2021 15:37, Roman

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-17 Thread Roman Skakun
Hi, Christoph I use Xen PV display. In my case, PV display backend(Dom0) allocates contiguous buffer via DMA-API to to implement zero-copy between Dom0 and DomU. When I start Weston under DomU, I got the next log in Dom0: ``` [ 112.554471] CPU: 0 PID: 367 Comm: weston Tainted: G O 5.10.0-yocto-st

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-16 Thread Roman Skakun
Hi Stefano, > Also, Option 1 listed in the webpage seems to be a lot better. Any > reason you can't do that? Because that option both solves the problem > and increases performance. Yes, Option 1 is probably more efficient. But I use another platform under Xen without DMA adjustment functionality

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-15 Thread Roman Skakun
Hi Jan, Thanks for the answer. >> From: Roman Skakun >> >> It is possible when default IO TLB size is not >> enough to fit a long buffers as described here [1]. >> >> This patch makes a way to set this parameter >> using cmdline instead of recompiling

[PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-14 Thread Roman Skakun
From: Roman Skakun It is possible when default IO TLB size is not enough to fit a long buffers as described here [1]. This patch makes a way to set this parameter using cmdline instead of recompiling a kernel. [1] https://www.xilinx.com/support/answers/72694.html Signed-off-by: Roman Skakun

Re: [GIT PULL] dma-mapping fix for Linux 5.14

2021-07-29 Thread Roman Skakun
Hi, Stefano! > I don't know on which platform Roman Skakun (CC'ed) found the problem. > But if we look at arch/arm/mm/dma-mapping.c:__dma_alloc, one of the > possible options is the "remap_allocator", which calls > __alloc_remap_buffer, which calls dma_common_cont

Re: [PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-07-21 Thread Roman Skakun
> Fine with. I've queued up the modified patch. Good. Thanks! > > On Sat, Jul 17, 2021 at 11:39:21AM +0300, Roman Skakun wrote: > > > We can merge this patch and create a new one for > > > xen_swiotlb_free_coherent() later. > > > Yeah

Re: [PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-07-17 Thread Roman Skakun
юл. 2021 г. в 18:29, Stefano Stabellini : > > On Fri, 16 Jul 2021, Roman Skakun wrote: > > > Technically this looks good. But given that exposing a helper > > > that does either vmalloc_to_page or virt_to_page is one of the > > > never ending MM discussions I don'

Re: [PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-07-16 Thread Roman Skakun
ine with me applying this version? > > --- > From 40ac971eab89330d6153e7721e88acd2d98833f9 Mon Sep 17 00:00:00 2001 > From: Roman Skakun > Date: Fri, 16 Jul 2021 11:39:34 +0300 > Subject: dma-mapping: handle vmalloc addresses in > dma_common_{mmap,get_sgtable} > > xen-swio

[PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-07-16 Thread Roman Skakun
From: Roman Skakun This commit is dedicated to fix incorrect conversion from cpu_addr to page address in cases when we get virtual address which allocated in the vmalloc range. As the result, virt_to_page() cannot convert this address properly and return incorrect page address. Need to detect

Re: [PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-07-15 Thread Roman Skakun
> This looks like it wasn't picked up? Should it go in rc1? Hi, Konrad! This looks like an unambiguous bug, and should be in rc1. Cheers! ср, 14 июл. 2021 г. в 03:15, Konrad Rzeszutek Wilk : > > On Tue, Jun 22, 2021 at 04:34:14PM +0300, Roman Skakun wrote: > > This commit

Re: [PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-07-15 Thread Roman Skakun
block in xen_swiotlb_free_coherent() need to make cpu_addr_to_page() as global and add a new declaration for this helper in include/linux/dma-map-ops.h. What do you think? Cheers! ср, 14 июл. 2021 г. в 04:23, Stefano Stabellini : > > On Tue, 22 Jun 2021, Roman Skakun wrote: > > This commit is dedic

[PATCH v2] dma-mapping: use vmalloc_to_page for vmalloc addresses

2021-06-22 Thread Roman Skakun
the page address using vmalloc_to_page() instead. Signed-off-by: Roman Skakun Reviewed-by: Andrii Anisov --- Hey! Thanks for suggestions, Christoph! I updated the patch according to your advice. But, I'm so surprised because nobody catches this problem in the common code before. It looks

Re: [PATCH] swiotlb-xen: override common mmap and get_sgtable dma ops

2021-06-16 Thread Roman Skakun
> We make sure that we allocate contiguous memory in > xen_swiotlb_alloc_coherent(). I understood. Thanks! -- Best Regards, Roman. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH 2/2] swiotlb-xen: override common mmap and get_sgtable dma ops

2021-06-16 Thread Roman Skakun
added a new dma_cpu_addr_to_page() helper. Signed-off-by: Roman Skakun Reviewed-by: Andrii Anisov --- drivers/xen/swiotlb-xen.c | 42 +++ 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index

[PATCH 1/2] Revert "swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable"

2021-06-16 Thread Roman Skakun
This reverts commit 922659ea771b3fd728149262c5ea15608fab9719. Signed-off-by: Roman Skakun --- drivers/xen/swiotlb-xen.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 2b385c1b4a99

Re: [PATCH] swiotlb-xen: override common mmap and get_sgtable dma ops

2021-06-14 Thread Roman Skakun
, 11 июн. 2021 г. в 18:20, Boris Ostrovsky : > > > On 6/11/21 5:55 AM, Roman Skakun wrote: > > > > +static int > > +xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, > > + void *cpu_addr, dma_addr_t dma_addr, size_t size, >

[PATCH] swiotlb-xen: override common mmap and get_sgtable dma ops

2021-06-11 Thread Roman Skakun
incorrect page address. Need to detect such cases and obtains the page address using vmalloc_to_page() instead. The reference code was copied from kernel/dma/ops_helpers.c and modified to provide additional detections as described above. Signed-off-by: Roman Skakun Reviewed-by: Andrii Anisov