Re: [PATCH v5 0/9] Use vm_insert_range

2018-12-24 Thread Russell King - ARM Linux
Having discussed with Matthew offlist, I think we've come to the following conclusion - there's a number of drivers that buggily ignore vm_pgoff. So, what I proposed is: static int __vm_insert_range(struct vm_struct *vma, struct page *pages, size_t num, unsigned long

Re: [PATCH v5 6/9] iommu/dma-iommu.c: Convert to use vm_insert_range

2018-12-24 Thread Russell King - ARM Linux
On Mon, Dec 24, 2018 at 06:55:31PM +0530, Souptick Joarder wrote: > Convert to use vm_insert_range() to map range of kernel > memory to user vma. > > Signed-off-by: Souptick Joarder > Reviewed-by: Matthew Wilcox > --- > drivers/iommu/dma-iommu.c | 13 +++-- > 1 file changed, 3 insertion

[PATCH v5 6/9] iommu/dma-iommu.c: Convert to use vm_insert_range

2018-12-24 Thread Souptick Joarder
Convert to use vm_insert_range() to map range of kernel memory to user vma. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox --- drivers/iommu/dma-iommu.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-

[PATCH v5 1/9] mm: Introduce new vm_insert_range API

2018-12-24 Thread Souptick Joarder
Previouly drivers have their own way of mapping range of kernel pages/memory into user vma and this was done by invoking vm_insert_page() within a loop. As this pattern is common across different drivers, it can be generalized by creating a new function and use it across the drivers. vm_insert_ra

[PATCH v5 0/9] Use vm_insert_range

2018-12-24 Thread Souptick Joarder
v1 -> v2: Address review comment on mm/memory.c. Add EXPORT_SYMBOL for vm_insert_range and corrected the documentation part for this API. In drivers/gpu/drm/xen/xen_drm_front_gem.c, replace err with ret as suggested. In drivers/iommu/dma-iommu.c, ha