Skip to contentSkip to conversation

tools-testing-vma-fix-vma-flag-tests.patch removed from -mm tree

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

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: tools/testing/vma: fix VMA flag tests
has been removed from the -mm tree. Its filename was
tools-testing-vma-fix-vma-flag-tests.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: "Lorenzo Stoakes (Oracle)" <[email protected]>
Subject: tools/testing/vma: fix VMA flag tests
Date: Fri, 20 Mar 2026 19:38:23 +0000

The VMA tests are incorrectly referencing NUM_VMA_FLAGS, which doesn't exist, rather they should reference NUM_VMA_FLAG_BITS.

Additionally, remove the custom-written implementation of __mk_vma_flags() as this means we are not testing the code as present in the kernel, rather add the actual __mk_vma_flags() to dup.h and add #ifdef's to handle declarations differently depending on NUM_VMA_FLAG_BITS.

Cc Albert Ou <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Alexandre Ghiti <[email protected]>
Cc Al Viro <[email protected]>
Cc Anton Ivanov <[email protected]>
Cc "Borislav Petkov (AMD)" <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Chengming Zhou <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Christian Brauner <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Huacai Chen <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jan Kara <[email protected]>
Cc Jann Horn <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Kees Cook <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Ondrej Mosnacek <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Moore <[email protected]>
Cc Pedro Falcato <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Russell King <[email protected]>
Cc Stephen Smalley <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Sven Schnelle <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Vlastimil Babka (SUSE) <[email protected]>
Cc WANG Xuerui <[email protected]>
Cc Will Deacon <[email protected]>
Cc xu xin <[email protected]>

---

 tools/testing/vma/include/custom.h |   19 -----
 tools/testing/vma/include/dup.h    |   21 +++++-
 tools/testing/vma/tests/vma.c      |   88 ++++++++++++++++++++++-----
 3 files changed, 92 insertions(+), 36 deletions(-)
tools/testing/vma/include/custom.h renamed from tools/testing/vma/include/custom.h~tools-testing-vma-fix-vma-flag-tests +0 -19
@@ -29,8 +29,6 @@ extern unsigned long dac_mmap_min_addr;
  */
 #define pr_warn_once pr_err
 
-#define pgtable_supports_soft_dirty() 1
-
 struct anon_vma {
 	struct anon_vma *root;
 	struct rb_root_cached rb_root;
@@ -99,23 +97,6 @@ static inline void vma_lock_init(struct
 		refcount_set(&vma->vm_refcnt, 0);
 }
 
-static __always_inline vma_flags_t __mk_vma_flags(size_t count,
-		const vma_flag_t *bits)
-{
-	vma_flags_t flags;
-	int i;
-
-	/*
-	 * For testing purposes: allow invalid bit specification so we can
-	 * easily test.
-	 */
-	vma_flags_clear_all(&flags);
-	for (i = 0; i < count; i++)
-		if (bits[i] < NUM_VMA_FLAG_BITS)
-			vma_flags_set_flag(&flags, bits[i]);
-	return flags;
-}
-
 static inline unsigned long vma_kernel_pagesize(struct vm_area_struct *vma)
 {
 	return PAGE_SIZE;
tools/testing/vma/include/dup.h renamed from tools/testing/vma/include/dup.h~tools-testing-vma-fix-vma-flag-tests +18 -3
@@ -854,10 +854,21 @@ static inline void vm_flags_clear(struct
 	vma_flags_clear_word(&vma->flags, flags);
 }
 
-static inline vma_flags_t __mk_vma_flags(size_t count, const vma_flag_t *bits);
+static __always_inline vma_flags_t __mk_vma_flags(size_t count,
+		const vma_flag_t *bits)
+{
+	vma_flags_t flags;
+	int i;
+
+	vma_flags_clear_all(&flags);
+	for (i = 0; i < count; i++)
+		vma_flags_set_flag(&flags, bits[i]);
 
-#define mk_vma_flags(...) __mk_vma_flags(COUNT_ARGS(__VA_ARGS__), \
-					 (const vma_flag_t []){__VA_ARGS__})
+	return flags;
+}
+
+#define mk_vma_flags(...) __mk_vma_flags(COUNT_ARGS(__VA_ARGS__),	\
+		(const vma_flag_t []){__VA_ARGS__})
 
 static __always_inline bool vma_flags_test(const vma_flags_t *flags,
 		vma_flag_t bit)
@@ -1390,3 +1401,7 @@ static inline int get_sysctl_max_map_cou
 {
 	return READ_ONCE(sysctl_max_map_count);
 }
+
+#ifndef pgtable_supports_soft_dirty
+#define pgtable_supports_soft_dirty()	IS_ENABLED(CONFIG_MEM_SOFT_DIRTY)
+#endif
tools/testing/vma/tests/vma.c renamed from tools/testing/vma/tests/vma.c~tools-testing-vma-fix-vma-flag-tests +74 -14

212 lines not on this page · raw message

_

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

maintainers-update-mglru-entry-to-reflect-current-status.patch selftests-mm-add-merge-test-for-partial-msealed-range.patch