From patchwork Mon Mar 1 08:22:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12108981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBE3EC433DB for ; Mon, 1 Mar 2021 08:23:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 582CF64DD3 for ; Mon, 1 Mar 2021 08:23:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 582CF64DD3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ED6388D004E; Mon, 1 Mar 2021 03:23:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E87548D004D; Mon, 1 Mar 2021 03:23:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9E7E8D004E; Mon, 1 Mar 2021 03:23:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id C28408D004D for ; Mon, 1 Mar 2021 03:23:02 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 946E5362E for ; Mon, 1 Mar 2021 08:23:02 +0000 (UTC) X-FDA: 77870615004.27.A664EFE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id E8615E4 for ; Mon, 1 Mar 2021 08:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=ZJ0mfKKiDbtOHzYkThItWPT9FVUPlFxXRW4kC39qdzY=; b=akuYuScZTOm/ePhqN+lw6tAh+X EeA0ICEb9zGHyikYeCvJg7Wvh1O70JU3poaBuBIZNXXf5truxXDrdhnwWiLpTOTCRedeSWhL6hW5A jfq3x1EZl+WkPvIP+iwJjd5o2+bN8PhaDW8q0GstVPsHEFKmJttf/FG5ftPnhGG+Ik6EeH/fB1fuF lKBIIbrYQNSEOcHppQHkklDe9a5F4ucZKtuI1x91Dho/SvWCDZtFwAkla83CbArIJ+gkouPw3nIap OwuaSwyXevJZowcBYIQgpNN4sU59W5uf1UpvdT9ybQTb16t1s9iJ1n8S/WEWZMKBPX0t46rRPkiFl eWIOnrgg==; Received: from [2001:4bb8:19b:e4b7:cdf9:733f:4874:8eb4] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lGdpD-00FTKm-Cy; Mon, 01 Mar 2021 08:22:49 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Kirti Wankhede , linux-mm@kvack.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] samples/vfio-mdev/mdpy: use remap_vmalloc_range Date: Mon, 1 Mar 2021 09:22:34 +0100 Message-Id: <20210301082235.932968-2-hch@lst.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301082235.932968-1-hch@lst.de> References: <20210301082235.932968-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E8615E4 X-Stat-Signature: 6artjbz4qq44dhkxfhmxa48twzew4ukr Received-SPF: none (casper.srs.infradead.org>: No applicable sender policy available) receiver=imf12; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614586974-320382 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use remap_vmalloc_range instead of open coding it using remap_vmalloc_range_partial. Signed-off-by: Christoph Hellwig --- samples/vfio-mdev/mdpy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/samples/vfio-mdev/mdpy.c b/samples/vfio-mdev/mdpy.c index 9894693f3be178..4fc73d0916ef7d 100644 --- a/samples/vfio-mdev/mdpy.c +++ b/samples/vfio-mdev/mdpy.c @@ -417,9 +417,7 @@ static int mdpy_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) if ((vma->vm_flags & VM_SHARED) == 0) return -EINVAL; - return remap_vmalloc_range_partial(vma, vma->vm_start, - mdev_state->memblk, 0, - vma->vm_end - vma->vm_start); + return remap_vmalloc_range(vma, mdev_state->memblk, 0); } static int mdpy_get_region_info(struct mdev_device *mdev, From patchwork Mon Mar 1 08:22:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12108983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D45EC433DB for ; Mon, 1 Mar 2021 08:23:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03F3464E45 for ; Mon, 1 Mar 2021 08:23:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03F3464E45 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 895788D0050; Mon, 1 Mar 2021 03:23:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 845F18D004F; Mon, 1 Mar 2021 03:23:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 783658D0050; Mon, 1 Mar 2021 03:23:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 6121F8D004F for ; Mon, 1 Mar 2021 03:23:07 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 31B9668AA for ; Mon, 1 Mar 2021 08:23:07 +0000 (UTC) X-FDA: 77870615214.14.9DA078C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id 4CC1380192C0 for ; Mon, 1 Mar 2021 08:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=aQ3dNWRxcZzJZQOoZSiGuk72NyhClVKZ8/+96ZjFy4M=; b=GpS19Cbg9z4GATzuoRB8Io7GDW KuzDnCYpBB+UctjlwsoCKL8Cphqwp7fRTzX+QYst3lCO1qo1y0MMmr8wF3pFVkuPTYz3dVjg52qxm ITI7t4ny1HamFivy0a+1KesueZ3v2uWXUHQCNLBh/WIJw79zX8A1U5qnF/3Wy0kVDEjqDDH5stHfY VBehoQ41/YfdVJDY6vv8otwa2x8qUzPG3g0RcsdQV60IWUF8Sn82BHazQDhT+8A7AT45oSoiGre0u RnM5aBtV08SUh8vE5FzYggvWAM8nBF1++j5vUBziynqclX0hctJwX1+0gfBIA3WN+AkjIKUxN54q7 cyyF6eDw==; Received: from [2001:4bb8:19b:e4b7:cdf9:733f:4874:8eb4] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lGdpU-00FTLN-DI; Mon, 01 Mar 2021 08:23:01 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Kirti Wankhede , linux-mm@kvack.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mm: unexport remap_vmalloc_range_partial Date: Mon, 1 Mar 2021 09:22:35 +0100 Message-Id: <20210301082235.932968-3-hch@lst.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301082235.932968-1-hch@lst.de> References: <20210301082235.932968-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: 5ziwwtegnzfybk5ayjibpj34ac3a1rgy X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4CC1380192C0 Received-SPF: none (casper.srs.infradead.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614586986-706957 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: remap_vmalloc_range_partial is only used to implement remap_vmalloc_range and by procfs. Unexport it. Signed-off-by: Christoph Hellwig --- mm/vmalloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 4f5f8c907897ae..631915ff6d1b4d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3072,7 +3072,6 @@ int remap_vmalloc_range_partial(struct vm_area_struct *vma, unsigned long uaddr, return 0; } -EXPORT_SYMBOL(remap_vmalloc_range_partial); /** * remap_vmalloc_range - map vmalloc pages to userspace