linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andrew Morton <akpm@linux-foundation.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	x86@kernel.org, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>,
	Laura Abbott <labbott@redhat.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>
Cc: Robin Murphy <robin.murphy@arm.com>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Peter Zijlstra <peterz@infradead.org>,
	linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-arch@vger.kernel.org, linux-mm@kvack.org,
	iommu@lists.linux-foundation.org,
	linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 17/28] mm: remove the prot argument from vm_map_ram
Date: Wed,  8 Apr 2020 13:59:15 +0200	[thread overview]
Message-ID: <20200408115926.1467567-18-hch@lst.de> (raw)
In-Reply-To: <20200408115926.1467567-1-hch@lst.de>

This is always GFP_KERNEL - for long term mappings with other properties
vmap should be used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c   | 2 +-
 drivers/media/common/videobuf2/videobuf2-dma-sg.c  | 3 +--
 drivers/media/common/videobuf2/videobuf2-vmalloc.c | 3 +--
 fs/erofs/decompressor.c                            | 2 +-
 fs/xfs/xfs_buf.c                                   | 2 +-
 include/linux/vmalloc.h                            | 3 +--
 mm/nommu.c                                         | 2 +-
 mm/vmalloc.c                                       | 4 ++--
 8 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c
index 9272bef57092..debaf7b18ab5 100644
--- a/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c
+++ b/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c
@@ -66,7 +66,7 @@ static void *mock_dmabuf_vmap(struct dma_buf *dma_buf)
 {
 	struct mock_dmabuf *mock = to_mock(dma_buf);
 
-	return vm_map_ram(mock->pages, mock->npages, 0, PAGE_KERNEL);
+	return vm_map_ram(mock->pages, mock->npages, 0);
 }
 
 static void mock_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr)
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
index 6db60e9d5183..92072a08af25 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
@@ -309,8 +309,7 @@ static void *vb2_dma_sg_vaddr(void *buf_priv)
 		if (buf->db_attach)
 			buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf);
 		else
-			buf->vaddr = vm_map_ram(buf->pages,
-					buf->num_pages, -1, PAGE_KERNEL);
+			buf->vaddr = vm_map_ram(buf->pages, buf->num_pages, -1);
 	}
 
 	/* add offset in case userptr is not page-aligned */
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
index 1a4f0ca87c7c..c66fda4a65e4 100644
--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c
+++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
@@ -107,8 +107,7 @@ static void *vb2_vmalloc_get_userptr(struct device *dev, unsigned long vaddr,
 		buf->vaddr = (__force void *)
 			ioremap(__pfn_to_phys(nums[0]), size + offset);
 	} else {
-		buf->vaddr = vm_map_ram(frame_vector_pages(vec), n_pages, -1,
-					PAGE_KERNEL);
+		buf->vaddr = vm_map_ram(frame_vector_pages(vec), n_pages, -1);
 	}
 
 	if (!buf->vaddr)
diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index 5d2d81940679..7628816f2453 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -274,7 +274,7 @@ static int z_erofs_decompress_generic(struct z_erofs_decompress_req *rq,
 
 	i = 0;
 	while (1) {
-		dst = vm_map_ram(rq->out, nrpages_out, -1, PAGE_KERNEL);
+		dst = vm_map_ram(rq->out, nrpages_out, -1);
 
 		/* retry two more times (totally 3 times) */
 		if (dst || ++i >= 3)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index f880141a2268..940af9da6db1 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -474,7 +474,7 @@ _xfs_buf_map_pages(
 		nofs_flag = memalloc_nofs_save();
 		do {
 			bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count,
-						-1, PAGE_KERNEL);
+						-1);
 			if (bp->b_addr)
 				break;
 			vm_unmap_aliases();
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 15ffbd8e8e65..9273b1a91ca5 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -88,8 +88,7 @@ struct vmap_area {
  *	Highlevel APIs for driver use
  */
 extern void vm_unmap_ram(const void *mem, unsigned int count);
-extern void *vm_map_ram(struct page **pages, unsigned int count,
-				int node, pgprot_t prot);
+extern void *vm_map_ram(struct page **pages, unsigned int count, int node);
 extern void vm_unmap_aliases(void);
 
 #ifdef CONFIG_MMU
diff --git a/mm/nommu.c b/mm/nommu.c
index 318df4e236c9..4f07b7ef0297 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -351,7 +351,7 @@ void vunmap(const void *addr)
 }
 EXPORT_SYMBOL(vunmap);
 
-void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot)
+void *vm_map_ram(struct page **pages, unsigned int count, int node)
 {
 	BUG();
 	return NULL;
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 258220b203f1..7356b3f07bd8 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1834,7 +1834,7 @@ EXPORT_SYMBOL(vm_unmap_ram);
  *
  * Returns: a pointer to the address that has been mapped, or %NULL on failure
  */
-void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot)
+void *vm_map_ram(struct page **pages, unsigned int count, int node)
 {
 	unsigned long size = (unsigned long)count << PAGE_SHIFT;
 	unsigned long addr;
@@ -1858,7 +1858,7 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
 
 	kasan_unpoison_vmalloc(mem, size);
 
-	if (map_kernel_range(addr, size, prot, pages) < 0) {
+	if (map_kernel_range(addr, size, PAGE_KERNEL, pages) < 0) {
 		vm_unmap_ram(mem, count);
 		return NULL;
 	}
-- 
2.25.1


  parent reply	other threads:[~2020-04-08 12:01 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 11:58 decruft the vmalloc API Christoph Hellwig
2020-04-08 11:58 ` [PATCH 01/28] x86/hyperv: use vmalloc_exec for the hypercall page Christoph Hellwig
2020-04-09 15:52   ` Wei Liu
2020-04-10 20:40   ` Michael Kelley
2020-04-08 11:59 ` [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram Christoph Hellwig
2020-04-08 13:27   ` Greg KH
2020-04-08 11:59 ` [PATCH 03/28] staging: media: ipu3: use vmap insted of reimplementing it Christoph Hellwig
2020-04-08 11:59 ` [PATCH 04/28] dma-mapping: " Christoph Hellwig
2020-04-08 11:59 ` [PATCH 05/28] powerpc: add an ioremap_phb helper Christoph Hellwig
2020-04-08 11:59 ` [PATCH 06/28] powerpc: remove __ioremap_at and __iounmap_at Christoph Hellwig
2020-04-08 11:59 ` [PATCH 07/28] mm: remove __get_vm_area Christoph Hellwig
2020-04-08 11:59 ` [PATCH 08/28] mm: unexport unmap_kernel_range_noflush Christoph Hellwig
2020-04-08 11:59 ` [PATCH 09/28] mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING Christoph Hellwig
2020-04-08 15:00   ` Randy Dunlap
2020-04-09 15:59   ` Minchan Kim
2020-04-08 11:59 ` [PATCH 10/28] mm: only allow page table mappings for built-in zsmalloc Christoph Hellwig
2020-04-08 15:01   ` Randy Dunlap
2020-04-08 15:12     ` Peter Zijlstra
2020-04-08 15:15       ` Matthew Wilcox
2020-04-08 15:36         ` Christoph Hellwig
2020-04-08 15:37           ` Randy Dunlap
2020-04-08 15:36         ` Randy Dunlap
2020-04-09 16:08   ` Minchan Kim
2020-04-09 16:50     ` Peter Zijlstra
2020-04-09 17:08       ` Minchan Kim
2020-04-10  2:38         ` Sergey Senozhatsky
2020-04-10 23:11           ` Minchan Kim
2020-04-11  7:20             ` Christoph Hellwig
2020-04-16 20:37               ` Minchan Kim
2020-04-08 11:59 ` [PATCH 11/28] mm: pass addr as unsigned long to vb_free Christoph Hellwig
2020-04-08 11:59 ` [PATCH 12/28] mm: remove vmap_page_range_noflush and vunmap_page_range Christoph Hellwig
2020-04-08 11:59 ` [PATCH 13/28] mm: rename vmap_page_range to map_kernel_range Christoph Hellwig
2020-04-08 11:59 ` [PATCH 14/28] mm: don't return the number of pages from map_kernel_range{,_noflush} Christoph Hellwig
2020-04-08 11:59 ` [PATCH 15/28] mm: remove map_vm_range Christoph Hellwig
2020-04-08 11:59 ` [PATCH 16/28] mm: remove unmap_vmap_area Christoph Hellwig
2020-04-08 11:59 ` Christoph Hellwig [this message]
2020-04-08 12:21   ` [PATCH 17/28] mm: remove the prot argument from vm_map_ram Peter Zijlstra
2020-04-08 12:23     ` Christoph Hellwig
2020-04-09  0:39   ` Gao Xiang
2020-04-08 11:59 ` [PATCH 18/28] mm: enforce that vmap can't map pages executable Christoph Hellwig
2020-04-08 12:38   ` Mark Rutland
2020-04-08 15:32     ` Christoph Hellwig
2020-04-08 11:59 ` [PATCH 19/28] gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc Christoph Hellwig
2020-04-08 12:25   ` Daniel Vetter
2020-04-09  8:54     ` Benjamin Herrenschmidt
2020-04-09  9:41       ` Daniel Vetter
2020-04-09 14:19         ` Alex Deucher
2020-04-09 14:57           ` Daniel Vetter
2020-04-09 22:56         ` Benjamin Herrenschmidt
2020-04-10  8:11           ` Daniel Vetter
2020-04-09 11:46       ` Gerhard Pircher
2020-04-08 11:59 ` [PATCH 20/28] mm: remove the pgprot argument to __vmalloc Christoph Hellwig
2020-04-10 20:39   ` Michael Kelley
2020-04-08 11:59 ` [PATCH 21/28] mm: remove the prot argument to __vmalloc_node Christoph Hellwig
2020-04-08 11:59 ` [PATCH 22/28] mm: remove both instances of __vmalloc_node_flags Christoph Hellwig
2020-04-08 11:59 ` [PATCH 23/28] mm: remove __vmalloc_node_flags_caller Christoph Hellwig
2020-04-08 11:59 ` [PATCH 24/28] mm: switch the test_vmalloc module to use __vmalloc_node Christoph Hellwig
2020-04-08 11:59 ` [PATCH 25/28] mm: remove vmalloc_user_node_flags Christoph Hellwig
2020-04-09 22:25   ` Andrii Nakryiko
2020-04-13 20:03     ` Johannes Weiner
2020-04-08 11:59 ` [PATCH 26/28] arm64: use __vmalloc_node in arch_alloc_vmap_stack Christoph Hellwig
2020-04-08 12:18   ` Mark Rutland
2020-04-08 11:59 ` [PATCH 27/28] s390: use __vmalloc_node in alloc_vm_stack Christoph Hellwig
2020-04-08 13:33   ` Christian Borntraeger
2020-04-08 11:59 ` [PATCH 28/28] s390: use __vmalloc_node in stack_alloc Christoph Hellwig
2020-04-08 13:44   ` Christian Borntraeger
2020-04-08 12:25 ` decruft the vmalloc API Peter Zijlstra
     [not found] ` <20200408124833.13032-1-hdanton@sina.com>
2020-04-08 15:40   ` [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram Christoph Hellwig
2020-04-08 16:03 ` decruft the vmalloc API Russell King - ARM Linux admin
2020-04-08 16:07   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200408115926.1467567-18-hch@lst.de \
    --to=hch@lst.de \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=bpf@vger.kernel.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haiyangz@microsoft.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kys@microsoft.com \
    --cc=labbott@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=peterz@infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sthemmin@microsoft.com \
    --cc=sumit.semwal@linaro.org \
    --cc=wei.liu@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).