Skip to contentSkip to conversation

mm-rename-zap_vma_ptes-to-zap_special_vma_range.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: rename zap_vma_ptes() to zap_special_vma_range()
has been removed from the -mm tree. Its filename was
mm-rename-zap_vma_ptes-to-zap_special_vma_range.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "David Hildenbrand (Arm)" <[email protected]>
Subject: mm: rename zap_vma_ptes() to zap_special_vma_range()
Date: Fri, 27 Feb 2026 21:08:46 +0100

zap_vma_ptes() is the only zapping function we export to modules.

It's essentially a wrapper around zap_vma_range(), however, with some safety checks:
* That the passed range fits fully into the VMA
* That it's only used for VM_PFNMAP

We will add support for VM_MIXEDMAP next, so use the more-generic term "special vma", although "special" is a bit overloaded. Maybe we'll later just support any VM_SPECIAL flag.

While at it, improve the kerneldoc.

Cc Alexander Gordeev <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Cc Alice Ryhl <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc "Borislav Petkov (AMD)" <[email protected]>
Cc Carlos Llamas <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc Daniel Borkman <[email protected]>
Cc Dave Airlie <[email protected]>
Cc David Ahern <[email protected]>
Cc David Rientjes <[email protected]>
Cc David S. Miller <[email protected]>
Cc Dimitri Sivanich <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Gerald Schaefer <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Hartley Sweeten <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Ian Abbott <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jakub Kacinski <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jann Horn <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Jonas Lahtinen <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Miguel Ojeda <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Namhyung kim <[email protected]>
Cc Neal Cardwell <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Pedro Falcato <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Vincenzo Frascino <[email protected]>

---

 arch/x86/kernel/cpu/sgx/encl.c        |    2 +-
 drivers/comedi/comedi_fops.c          |    2 +-
 drivers/gpu/drm/i915/i915_mm.c        |    4 ++--
 drivers/infiniband/core/uverbs_main.c |    6 +++---
 drivers/misc/sgi-gru/grumain.c        |    2 +-
 include/linux/mm.h                    |    2 +-
 mm/memory.c                           |   16 +++++++---------
 7 files changed, 16 insertions(+), 18 deletions(-)
arch/x86/kernel/cpu/sgx/encl.c renamed from arch/x86/kernel/cpu/sgx/encl.c~mm-rename-zap_vma_ptes-to-zap_special_vma_range +1 -1
@@ -1220,7 +1220,7 @@ void sgx_zap_enclave_ptes(struct sgx_enc
 
 			ret = sgx_encl_find(encl_mm->mm, addr, &vma);
 			if (!ret && encl == vma->vm_private_data)
-				zap_vma_ptes(vma, addr, PAGE_SIZE);
+				zap_special_vma_range(vma, addr, PAGE_SIZE);
 
 			mmap_read_unlock(encl_mm->mm);
 
drivers/comedi/comedi_fops.c renamed from drivers/comedi/comedi_fops.c~mm-rename-zap_vma_ptes-to-zap_special_vma_range +1 -1
@@ -2588,7 +2588,7 @@ static int comedi_mmap(struct file *file
 	 * remap_pfn_range() because we call remap_pfn_range() in a loop.
 	 */
 	if (retval)
-		zap_vma_ptes(vma, vma->vm_start, size);
+		zap_special_vma_range(vma, vma->vm_start, size);
 #endif
 
 	if (retval == 0) {
drivers/gpu/drm/i915/i915_mm.c renamed from drivers/gpu/drm/i915/i915_mm.c~mm-rename-zap_vma_ptes-to-zap_special_vma_range +2 -2
@@ -108,7 +108,7 @@ int remap_io_mapping(struct vm_area_stru
 
 	err = apply_to_page_range(r.mm, addr, size, remap_pfn, &r);
 	if (unlikely(err)) {
-		zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
+		zap_special_vma_range(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
 		return err;
 	}
 
@@ -156,7 +156,7 @@ int remap_io_sg(struct vm_area_struct *v
 
 	err = apply_to_page_range(r.mm, addr, size, remap_sg, &r);
 	if (unlikely(err)) {
-		zap_vma_ptes(vma, addr, r.pfn << PAGE_SHIFT);
+		zap_special_vma_range(vma, addr, r.pfn << PAGE_SHIFT);
 		return err;
 	}
 
drivers/infiniband/core/uverbs_main.c renamed from drivers/infiniband/core/uverbs_main.c~mm-rename-zap_vma_ptes-to-zap_special_vma_range +3 -3
@@ -756,7 +756,7 @@ out_zap:
 	 * point, so zap it.
 	 */
 	vma->vm_private_data = NULL;
-	zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start);
+	zap_special_vma_range(vma, vma->vm_start, vma->vm_end - vma->vm_start);
 }
 
 static void rdma_umap_close(struct vm_area_struct *vma)
@@ -782,7 +782,7 @@ static void rdma_umap_close(struct vm_ar
 }
 
 /*
- * Once the zap_vma_ptes has been called touches to the VMA will come here and
+ * Once the zap_special_vma_range has been called touches to the VMA will come here and
  * we return a dummy writable zero page for all the pfns.
  */
 static vm_fault_t rdma_umap_fault(struct vm_fault *vmf)
@@ -878,7 +878,7 @@ void uverbs_user_mmap_disassociate(struc
 				continue;
 			list_del_init(&priv->list);
 
-			zap_vma_ptes(vma, vma->vm_start,
+			zap_special_vma_range(vma, vma->vm_start,
 				     vma->vm_end - vma->vm_start);
 
 			if (priv->entry) {
drivers/misc/sgi-gru/grumain.c renamed from drivers/misc/sgi-gru/grumain.c~mm-rename-zap_vma_ptes-to-zap_special_vma_range +1 -1
@@ -542,7 +542,7 @@ void gru_unload_context(struct gru_threa
 	int ctxnum = gts->ts_ctxnum;
 
 	if (!is_kernel_context(gts))
-		zap_vma_ptes(gts->ts_vma, UGRUADDR(gts), GRU_GSEG_PAGESIZE);
+		zap_special_vma_range(gts->ts_vma, UGRUADDR(gts), GRU_GSEG_PAGESIZE);
 	cch = get_cch(gru->gs_gru_base_vaddr, ctxnum);
 
 	gru_dbg(grudev, "gts %p, cbrmap 0x%lx, dsrmap 0x%lx\n",
include/linux/mm.h renamed from include/linux/mm.h~mm-rename-zap_vma_ptes-to-zap_special_vma_range +1 -1
@@ -2802,7 +2802,7 @@ struct page *vm_normal_page_pmd(struct v
 struct page *vm_normal_page_pud(struct vm_area_struct *vma, unsigned long addr,
 		pud_t pud);
 
-void zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
+void zap_special_vma_range(struct vm_area_struct *vma, unsigned long address,
 		  unsigned long size);
 void zap_vma_range(struct vm_area_struct *vma, unsigned long address,
 			   unsigned long size);
mm/memory.c renamed from mm/memory.c~mm-rename-zap_vma_ptes-to-zap_special_vma_range +7 -9
@@ -2233,17 +2233,15 @@ void zap_vma_range(struct vm_area_struct
 }
 
 /**
- * zap_vma_ptes - remove ptes mapping the vma
- * @vma: vm_area_struct holding ptes to be zapped
- * @address: starting address of pages to zap
+ * zap_special_vma_range - zap all page table entries in a special vma range
+ * @vma: the vma covering the range to zap
+ * @address: starting address of the range to zap
  * @size: number of bytes to zap
  *
- * This function only unmaps ptes assigned to VM_PFNMAP vmas.
- *
- * The entire address range must be fully contained within the vma.
- *
+ * This function does nothing when the provided address range is not fully
+ * contained in @vma, or when the @vma is not VM_PFNMAP.
  */
-void zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
+void zap_special_vma_range(struct vm_area_struct *vma, unsigned long address,
 		unsigned long size)
 {
 	if (!range_in_vma(vma, address, address + size) ||
@@ -2252,7 +2250,7 @@ void zap_vma_ptes(struct vm_area_struct
 
 	zap_vma_range(vma, address, size);
 }
-EXPORT_SYMBOL_GPL(zap_vma_ptes);
+EXPORT_SYMBOL_GPL(zap_special_vma_range);
 
 static pmd_t *walk_to_pmd(struct mm_struct *mm, unsigned long addr)
 {

_

Patches currently in -mm which might be from [email protected] are