From patchwork Sun Dec 2 06:17:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10708303 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 C98791057 for ; Sun, 2 Dec 2018 21:23:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B79AB2A624 for ; Sun, 2 Dec 2018 21:23:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8F942A62C; Sun, 2 Dec 2018 21:23:07 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 68D042A624 for ; Sun, 2 Dec 2018 21:23:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 82A8989B97; Sun, 2 Dec 2018 21:23:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 929D36E152 for ; Sun, 2 Dec 2018 06:13:25 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id g189so4282449pgc.5 for ; Sat, 01 Dec 2018 22:13:25 -0800 (PST) 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=QkWGefk1uOV7uhsAtF573lEHHJSsrTRZEoJ/EEqbupA=; b=kUuLl0ltTGT3sK6ahoS1gf+z38y7/oLoDkW4kiDKJ7vhqiyeIIViqArIskgLJYjL7N Gav9lnBR0BFHKtmuFICmgnzf2IIBERayMl4NrtbL3AcdORQCN66AsA+x3nloQMB+3Br0 Qyaex2svFdtzev5Bh8CI+A3+gTlkQS7oNshqOzMHhPpNcfuJImLocUfkCWmmYWSdcSk5 AyUj2hIGPiYJWhnXy2EKfK0b6T4ENK5YVr4XPS5rBF155n6KZp8d1lfullNDo7YJGenG wVscfcy3vkfXQJ6i/E3pFL9esguHaIsnJpwMldsj+3+KY3tCo0LyHK0CdKvWYW++ijnm xavQ== X-Gm-Message-State: AA+aEWZthWJTNR3wb5WMLSvvAVZqgXv0rNmRmuWJiMVAL1qlf5wcgOkK QODdCV6Eat9IWQ5oaVfFlgo= X-Google-Smtp-Source: AFSGD/VadVkIzzhs3ZrvwCPB7PLdPaDENychA8ssT0abv5PurP9XiiGYd+5YwEv4HTNWB3Yc/RO8mQ== X-Received: by 2002:a62:b9a:: with SMTP id 26mr11586637pfl.196.1543731204982; Sat, 01 Dec 2018 22:13:24 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([103.227.99.148]) by smtp.gmail.com with ESMTPSA id d80sm33964454pfm.146.2018.12.01.22.13.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 01 Dec 2018 22:13:23 -0800 (PST) Date: Sun, 2 Dec 2018 11:47:07 +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 v2 0/9] Use vm_insert_range Message-ID: <20181202061707.GA3070@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Sun, 02 Dec 2018 21:23:01 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. 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, handle the scenario of partial mmap() of large buffer by passing *pages + vma->vm_pgoff* to vm_insert_range(). 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 | 13 ++------ 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 | 38 +++++++++++++++++++++++ mm/nommu.c | 7 +++++ 11 files changed, 81 insertions(+), 98 deletions(-)