linux-next: Build failure after merge of the tip tree

Message ID 20230419182136.112974-1-broonie@kernel.org
State New
Headers
Series linux-next: Build failure after merge of the tip tree |

Commit Message

Mark Brown April 19, 2023, 6:21 p.m. UTC
  Hi all,

After merging the rcu tree, today's linux-next build (arm64 defconfig)
failed like this:

/tmp/next/build/mm/migrate.c: In function 'remove_migration_pte':
/tmp/next/build/mm/migrate.c:222:31: error: too few arguments to function 'pte_mkwrite'
  222 |                         pte = pte_mkwrite(pte);
      |                               ^~~~~~~~~~~
In file included from /tmp/next/build/include/linux/pgtable.h:6,
                 from /tmp/next/build/include/linux/mm.h:29,
                 from /tmp/next/build/include/linux/migrate.h:5,
                 from /tmp/next/build/mm/migrate.c:16:
/tmp/next/build/arch/arm64/include/asm/pgtable.h:190:21: note: declared here
  190 | static inline pte_t pte_mkwrite(pte_t pte, struct vm_area_struct *vma)
      |                     ^~~~~~~~~~~

Caused by commit

  717f95b494ac36 ("mm: don't check VMA write permissions if the PTE/PMD indicates write permissions")

from the mm tree interacting with

  74fd30bd28e4c7 ("mm: Make pte_mkwrite() take a VMA")

from the tip tree.  I've applied the fixup below
  

Comments

Borislav Petkov April 19, 2023, 6:50 p.m. UTC | #1
On Wed, Apr 19, 2023 at 07:21:36PM +0100, broonie@kernel.org wrote:
> Hi all,
> 
> After merging the rcu tree, today's linux-next build (arm64 defconfig)
> failed like this:
> 
> /tmp/next/build/mm/migrate.c: In function 'remove_migration_pte':
> /tmp/next/build/mm/migrate.c:222:31: error: too few arguments to function 'pte_mkwrite'
>   222 |                         pte = pte_mkwrite(pte);
>       |                               ^~~~~~~~~~~
> In file included from /tmp/next/build/include/linux/pgtable.h:6,
>                  from /tmp/next/build/include/linux/mm.h:29,
>                  from /tmp/next/build/include/linux/migrate.h:5,
>                  from /tmp/next/build/mm/migrate.c:16:
> /tmp/next/build/arch/arm64/include/asm/pgtable.h:190:21: note: declared here
>   190 | static inline pte_t pte_mkwrite(pte_t pte, struct vm_area_struct *vma)
>       |                     ^~~~~~~~~~~
> 
> Caused by commit
> 
>   717f95b494ac36 ("mm: don't check VMA write permissions if the PTE/PMD indicates write permissions")
> 
> from the mm tree interacting with
> 
>   74fd30bd28e4c7 ("mm: Make pte_mkwrite() take a VMA")
> 
> from the tip tree.  I've applied the fixup below

Thanks for letting us know - we'll keep this in mind when sending the
piles of patches to Linus next week.
  

Patch

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 1cc86d0a669e8..c3cc20c1b26cb 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2235,7 +2235,7 @@  static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
 		} else {
 			entry = mk_pte(page + i, READ_ONCE(vma->vm_page_prot));
 			if (write)
-				entry = pte_mkwrite(entry);
+				entry = pte_mkwrite(entry, vma);
 			if (anon_exclusive)
 				SetPageAnonExclusive(page + i);
 			if (!young)
@@ -3272,7 +3272,7 @@  void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
 	if (pmd_swp_soft_dirty(*pvmw->pmd))
 		pmde = pmd_mksoft_dirty(pmde);
 	if (is_writable_migration_entry(entry))
-		pmde = pmd_mkwrite(pmde);
+		pmde = pmd_mkwrite(pmde, vma);
 	if (pmd_swp_uffd_wp(*pvmw->pmd))
 		pmde = pmd_mkuffd_wp(pmde);
 	if (!is_migration_entry_young(entry))
diff --git a/mm/migrate.c b/mm/migrate.c
index 01cac26a31279..8b46b722f1a44 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -219,7 +219,7 @@  static bool remove_migration_pte(struct folio *folio,
 		if (folio_test_dirty(folio) && is_migration_entry_dirty(entry))
 			pte = pte_mkdirty(pte);
 		if (is_writable_migration_entry(entry))
-			pte = pte_mkwrite(pte);
+			pte = pte_mkwrite(pte, vma);
 		else if (pte_swp_uffd_wp(*pvmw.pte))
 			pte = pte_mkuffd_wp(pte);