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

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

2021-06-14 Thread Boris Ostrovsky
On 6/14/21 8:47 AM, Roman Skakun wrote: > Hey, Boris! > Thanks for the review. > > I have an additional question about current implementation that disturbed me. > I think, that we can have cases when mapped memory can not be > physically contiguous. > In order to proceed this correctly need to ap

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

2021-06-14 Thread Roman Skakun
Hey, Boris! Thanks for the review. I have an additional question about current implementation that disturbed me. I think, that we can have cases when mapped memory can not be physically contiguous. In order to proceed this correctly need to apply some additional steps to current implementation as

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

2021-06-11 Thread Roman Skakun
This commit is dedicated to fix incorrect convertion from cpu_addr to page address in cases when we get virtual address which allocated throught xen_swiotlb_alloc_coherent() and can be mapped in the vmalloc range. As the result, virt_to_page() cannot convert this address properly and return incorre

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

2021-06-11 Thread 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, > + unsigned long attrs) > +{ > + unsigned long user_count = vma_pages(vma); > +