Skip to contentSkip to conversation

mm-extend-max-struct-page-size-for-kmsan.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Feb 4, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: extend max struct page size for kmsan
has been removed from the -mm tree. Its filename was
mm-extend-max-struct-page-size-for-kmsan.patch

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

------------------------------------------------------
From: Arnd Bergmann <[email protected]>
Subject: mm: extend max struct page size for kmsan
Date: Mon, 30 Jan 2023 14:07:26 +0100

After x86 enabled support for KMSAN, it has become possible to have larger 'struct page' than was expected when commit 5470dea49f53 ("mm: use mm_zero_struct_page from SPARC on all 64b architectures") was merged:

include/linux/mm.h:156:10: warning: no case matching constant switch condition '96'

        switch (sizeof(struct page)) {

Extend the maximum accordingly.

Fixes 5470dea49f53 ("mm: use mm_zero_struct_page from SPARC on all 64b architectures")
Fixes 4ca8cc8d1bbe ("x86: kmsan: enable KMSAN builds for x86")
Fixes f80be4571b19 ("kmsan: add KMSAN runtime core")
Cc Alexander Duyck <[email protected]>
Cc Alexander Potapenko <[email protected]>
Cc Alex Sierra <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc John Hubbard <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Suren Baghdasaryan <[email protected]>

---

include/linux/mm.h renamed from include/linux/mm.h~mm-extend-max-struct-page-size-for-kmsan +9 -3
@@ -137,7 +137,7 @@ extern int mmap_rnd_compat_bits __read_m
  * define their own version of this macro in <asm/pgtable.h>
  */
 #if BITS_PER_LONG == 64
-/* This function must be updated when the size of struct page grows above 80
+/* This function must be updated when the size of struct page grows above 96
  * or reduces below 56. The idea that compiler optimizes out switch()
  * statement, and only leaves move/store instructions. Also the compiler can
  * combine write statements if they are both assignments and can be reordered,
@@ -148,12 +148,18 @@ static inline void __mm_zero_struct_page
 {
 	unsigned long *_pp = (void *)page;
 
-	 /* Check that struct page is either 56, 64, 72, or 80 bytes */
+	 /* Check that struct page is either 56, 64, 72, 80, 88 or 96 bytes */
 	BUILD_BUG_ON(sizeof(struct page) & 7);
 	BUILD_BUG_ON(sizeof(struct page) < 56);
-	BUILD_BUG_ON(sizeof(struct page) > 80);
+	BUILD_BUG_ON(sizeof(struct page) > 96);
 
 	switch (sizeof(struct page)) {
+	case 96:
+		_pp[11] = 0;
+		fallthrough;
+	case 88:
+		_pp[10] = 0;
+		fallthrough;
 	case 80:
 		_pp[9] = 0;
 		fallthrough;

_

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