From patchwork Thu Nov 15 15:43:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10684641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6B0C13BF for ; Thu, 15 Nov 2018 15:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9216B2BDF4 for ; Thu, 15 Nov 2018 15:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82B962CA0A; Thu, 15 Nov 2018 15:40:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B62EA2BDF4 for ; Thu, 15 Nov 2018 15:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mKazUYLA4KbfV4h3DNNkIT2gMXB7CVTsmr3ayzQRsW4=; b=ThcwnLOjveWqeY vm+aeFkhLqQMXJXhl6MdA7cmm7473Xm+VpEsV6hpr8+MaM6hGHydqF5rlFKsuvFxU6lYM3ZFJdU/V 5GUQi3s+2flX1RUEcDeFf25koQHlqmxYj0JYRwowuSZbMHUQK7YCi45NgSRScbImJedFGNmRBk8SQ B8HBXOlIpVSin5IZ11JfWld2Pr44Zk0uD6byOS8KLHNeiMuvxpeegAx1vU6Ds3TIpD8UObmUK5uUA VIArcoVq+utVReWPqAgp/iWNbrjanR54+dCdS0TkgetHo1sQWH+NPzdBTv1fZQUDmskZazPJgBqll OJFZa75ghtjC8y2kcUHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNJkI-0003c1-NO; Thu, 15 Nov 2018 15:39:54 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNJkF-0003Zy-6A; Thu, 15 Nov 2018 15:39:52 +0000 Received: by mail-pg1-x544.google.com with SMTP id n2so2001294pgm.3; Thu, 15 Nov 2018 07:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=k7YhP8SU7rzdO2cfLJKZnWQx6wMxbtBlZWcB8cpbHjE=; b=PhLumYCaR5dQAx+R6tkONFpiyswMbRUWcrJ1mQjfmmA1SGYKUYbEOJQPQ2AK3kq3+4 IOM8sAzHrjxeOrirmUAbMn+zo6vimswT13HtlD/k7BpW7rYEktbU75JenrU9hPrPcfkJ 0hsrJyA9uvibiIr+3HazOg04EOnnuyAajTtL06ZT6Gc7OM0sqsXU8LW/VvDhG2KG+g20 hxYA3+ORfxC3D+nCoAi3p27ztW+Jdoe++HvPyWK+a8Mk9FOGZI0SoA616D1yZmhGzZPg o+HFiO6NeG/FJ0NC4nLc1yDOgrM3IJKgaTp8cfOmC+4sh15lO9EqOt8SXB3TaAxccWxc c3Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=k7YhP8SU7rzdO2cfLJKZnWQx6wMxbtBlZWcB8cpbHjE=; b=BQIz4gr04Zbk5pFrggvZVI1tycpyu+UpexV/F32xZXz7VOCRAX0lz4bENt8F4k9+L7 8ncisDEUBkttppLI5ZCXOY8lhroQWEu6xa1xSZK6hu/XhR/AgJext6xuDAa/QkjUnvdO pxryMLhNAWj4505xWAXAoiS4UnyngdqXvE6k/7FltaAjQzWFvIqwfT3wtMPwbzKIc7Ys 1oc0mQ0CZLOTA75f3IAppTUTBM1IWf4fa0JNih4MD4o5CvCjPaTWfFPe7XfXoE8598l8 RDJ4ZrJc/oh41cGB3tScNTI71vCn0Sps/rpw1ly41z6Gmgujk3vEqYhEoXVGOcbT5wAh H9bg== X-Gm-Message-State: AGRZ1gL7qCvx4uk0etnGaoZVfD2nu3gOkf5Abh5NltRrEAl4KCDYV2uJ rnC/1phKVqZFTSgcGFt0oX0= X-Google-Smtp-Source: AJdET5dFBMDj1krLNWt58fbSZfUFEu9jXazKuDbFpNQ7sH8hvnircMBzVteGRl8Y5b94E1Pkm8aUyg== X-Received: by 2002:a63:4b60:: with SMTP id k32mr6176757pgl.186.1542296379954; Thu, 15 Nov 2018 07:39:39 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([103.227.97.233]) by smtp.gmail.com with ESMTPSA id v12sm29037162pgg.41.2018.11.15.07.39.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Nov 2018 07:39:38 -0800 (PST) Date: Thu, 15 Nov 2018 21:13:14 +0530 From: Souptick Joarder To: akpm@linux-foundation.org, willy@infradead.org, mhocko@suse.com, kirill.shutemov@linux.intel.com, vbabka@suse.cz, riel@surriel.com, sfr@canb.auug.org.au, rppt@linux.vnet.ibm.com, peterz@infradead.org, linux@armlinux.org.uk, robin.murphy@arm.com, iamjoonsoo.kim@lge.com, treding@nvidia.com, keescook@chromium.org, m.szyprowski@samsung.com, stefanr@s5r6.in-berlin.de, hjc@rock-chips.com, heiko@sntech.de, airlied@linux.ie, oleksandr_andrushchenko@epam.com, joro@8bytes.org, pawel@osciak.com, kyungmin.park@samsung.com, mchehab@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com Subject: [PATCH 0/9] Use vm_insert_range Message-ID: <20181115154314.GA27850@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_073951_226121_AF265F44 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, linux1394-devel@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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_range is the new API which will be used to map a range of kernel memory/pages to user vma. All the applicable places are converted to use new vm_insert_range in this patch series. Souptick Joarder (9): mm: Introduce new vm_insert_range API arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range drivers/firewire/core-iso.c: Convert to use vm_insert_range drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range iommu/dma-iommu.c: Convert to use vm_insert_range videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range xen/gntdev.c: Convert to use vm_insert_range xen/privcmd-buf.c: Convert to use vm_insert_range arch/arm/mm/dma-mapping.c | 21 ++++++----------- drivers/firewire/core-iso.c | 15 ++---------- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 20 ++-------------- drivers/gpu/drm/xen/xen_drm_front_gem.c | 20 +++++----------- drivers/iommu/dma-iommu.c | 12 ++-------- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 23 ++++++------------- drivers/xen/gntdev.c | 11 ++++----- drivers/xen/privcmd-buf.c | 8 ++----- include/linux/mm_types.h | 3 +++ mm/memory.c | 28 +++++++++++++++++++++++ mm/nommu.c | 7 ++++++ 11 files changed, 70 insertions(+), 98 deletions(-) Reviewed-by: Boris Ostrovsky