linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the maple tree
@ 2022-02-17  8:27 Stephen Rothwell
  2022-02-18  2:14 ` Liam Howlett
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2022-02-17  8:27 UTC (permalink / raw)
  To: Liam Howlett
  Cc: Matthew Wilcox (Oracle),
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Hi all,

After merging the maple tree, today's linux-next build (powerpc
allyesconfig) failed like this:

In file included from /home/sfr/next/next/mm/damon/vaddr.c:762:
/home/sfr/next/next/mm/damon/vaddr-test.h: In function 'damon_test_three_regions_in_vmas':
/home/sfr/next/next/mm/damon/vaddr-test.h:85:1: error: the frame size of 2720 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
   85 | }
      | ^
cc1: all warnings being treated as errors

Caused by commit

  42672fae77a4 ("damon: Convert __damon_va_three_regions to use the VMA iterator")

I have dropped the maple tree for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: linux-next: build failure after merge of the maple tree
  2022-02-17  8:27 linux-next: build failure after merge of the maple tree Stephen Rothwell
@ 2022-02-18  2:14 ` Liam Howlett
  0 siblings, 0 replies; 7+ messages in thread
From: Liam Howlett @ 2022-02-18  2:14 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Matthew Wilcox (Oracle),
	Linux Kernel Mailing List, Linux Next Mailing List

Hi Stephen,

I've fixed up the frame size below and the internal maple tree frame
sizes and pushed fixes.

Thanks,
Liam

* Stephen Rothwell <sfr@canb.auug.org.au> [220217 03:27]:
> Hi all,
> 
> After merging the maple tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> In file included from /home/sfr/next/next/mm/damon/vaddr.c:762:
> /home/sfr/next/next/mm/damon/vaddr-test.h: In function 'damon_test_three_regions_in_vmas':
> /home/sfr/next/next/mm/damon/vaddr-test.h:85:1: error: the frame size of 2720 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>    85 | }
>       | ^
> cc1: all warnings being treated as errors
> 
> Caused by commit
> 
>   42672fae77a4 ("damon: Convert __damon_va_three_regions to use the VMA iterator")
> 
> I have dropped the maple tree for today.
> 
> -- 
> Cheers,
> Stephen Rothwell


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: linux-next: build failure after merge of the maple tree
  2022-02-23  0:45 broonie
@ 2022-02-23  2:32 ` Liam Howlett
  0 siblings, 0 replies; 7+ messages in thread
From: Liam Howlett @ 2022-02-23  2:32 UTC (permalink / raw)
  To: broonie
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Catalin Marinas, Will Deacon

* broonie@kernel.org <broonie@kernel.org> [220222 19:45]:
> Hi all,
> 
> After merging the maple tree, today's linux-next build (KCONFIG_NAME)
> failed like this:
> 
> /tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_phdrs':
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                     ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:69:2: note: in expansion of macro 'for_each_mte_vma'
>    69 |  for_each_mte_vma(current, vma)
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                                           ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:69:2: note: in expansion of macro 'for_each_mte_vma'
>    69 |  for_each_mte_vma(current, vma)
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_phdrs':
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                     ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:79:2: note: in expansion of macro 'for_each_mte_vma'
>    79 |  for_each_mte_vma(current, vma) {
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                                           ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:79:2: note: in expansion of macro 'for_each_mte_vma'
>    79 |  for_each_mte_vma(current, vma) {
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_data_size':
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                     ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:104:2: note: in expansion of macro 'for_each_mte_vma'
>   104 |  for_each_mte_vma(current, vma)
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                                           ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:104:2: note: in expansion of macro 'for_each_mte_vma'
>   104 |  for_each_mte_vma(current, vma)
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_data':
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                     ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:114:2: note: in expansion of macro 'for_each_mte_vma'
>   114 |  for_each_mte_vma(current, vma) {
>       |  ^~~~~~~~~~~~~~~~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
>       |                                           ^~
> /tmp/next/build/arch/arm64/kernel/elfcore.c:114:2: note: in expansion of macro 'for_each_mte_vma'
>   114 |  for_each_mte_vma(current, vma) {
>       |  ^~~~~~~~~~~~~~~~
> 
> I did not identify the commit which triggered this. I have used the
> maple tree from 20220217 instead.

Hello,

I had generated a fix for this on the 17th and sent it to linux-next
[1].  Alternatively, the patch is inline below.

1: https://lore.kernel.org/all/20220218023650.672072-1-Liam.Howlett@oracle.com/

Thanks,
Liam

----------------------------------------------------------------------
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Date: Thu, 17 Feb 2022 21:16:53 -0500
Subject: [PATCH] arm64: Change elfcore for_each_mte_vma() to use VMA iterator

Instead of using the linked list, use the vma iterator.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
 arch/arm64/kernel/elfcore.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/elfcore.c b/arch/arm64/kernel/elfcore.c
index 3455ee4acc04..930a0bc4cac4 100644
--- a/arch/arm64/kernel/elfcore.c
+++ b/arch/arm64/kernel/elfcore.c
@@ -8,9 +8,9 @@
 #include <asm/cpufeature.h>
 #include <asm/mte.h>
 
-#define for_each_mte_vma(tsk, vma)					\
+#define for_each_mte_vma(vmi, vma)					\
 	if (system_supports_mte())					\
-		for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)	\
+		for_each_vma(vmi, vma)					\
 			if (vma->vm_flags & VM_MTE)
 
 static unsigned long mte_vma_tag_dump_size(struct vm_area_struct *vma)
@@ -65,8 +65,9 @@ Elf_Half elf_core_extra_phdrs(void)
 {
 	struct vm_area_struct *vma;
 	int vma_count = 0;
+	VMA_ITERATOR(vmi, current->mm, 0);
 
-	for_each_mte_vma(current, vma)
+	for_each_mte_vma(vmi, vma)
 		vma_count++;
 
 	return vma_count;
@@ -75,8 +76,9 @@ Elf_Half elf_core_extra_phdrs(void)
 int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
 {
 	struct vm_area_struct *vma;
+	VMA_ITERATOR(vmi, current->mm, 0);
 
-	for_each_mte_vma(current, vma) {
+	for_each_mte_vma(vmi, vma) {
 		struct elf_phdr phdr;
 
 		phdr.p_type = PT_ARM_MEMTAG_MTE;
@@ -100,8 +102,9 @@ size_t elf_core_extra_data_size(void)
 {
 	struct vm_area_struct *vma;
 	size_t data_size = 0;
+	VMA_ITERATOR(vmi, current->mm, 0);
 
-	for_each_mte_vma(current, vma)
+	for_each_mte_vma(vmi, vma)
 		data_size += mte_vma_tag_dump_size(vma);
 
 	return data_size;
@@ -110,8 +113,9 @@ size_t elf_core_extra_data_size(void)
 int elf_core_write_extra_data(struct coredump_params *cprm)
 {
 	struct vm_area_struct *vma;
+	VMA_ITERATOR(vmi, current->mm, 0);
 
-	for_each_mte_vma(current, vma) {
+	for_each_mte_vma(vmi, vma) {
 		if (vma->vm_flags & VM_DONTDUMP)
 			continue;
 
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* linux-next: build failure after merge of the maple tree
@ 2022-02-23  0:45 broonie
  2022-02-23  2:32 ` Liam Howlett
  0 siblings, 1 reply; 7+ messages in thread
From: broonie @ 2022-02-23  0:45 UTC (permalink / raw)
  To: Liam Howlett
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Catalin Marinas, Will Deacon

Hi all,

After merging the maple tree, today's linux-next build (KCONFIG_NAME)
failed like this:

/tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_phdrs':
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                     ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:69:2: note: in expansion of macro 'for_each_mte_vma'
   69 |  for_each_mte_vma(current, vma)
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                                           ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:69:2: note: in expansion of macro 'for_each_mte_vma'
   69 |  for_each_mte_vma(current, vma)
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_phdrs':
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                     ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:79:2: note: in expansion of macro 'for_each_mte_vma'
   79 |  for_each_mte_vma(current, vma) {
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                                           ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:79:2: note: in expansion of macro 'for_each_mte_vma'
   79 |  for_each_mte_vma(current, vma) {
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_data_size':
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                     ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:104:2: note: in expansion of macro 'for_each_mte_vma'
  104 |  for_each_mte_vma(current, vma)
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                                           ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:104:2: note: in expansion of macro 'for_each_mte_vma'
  104 |  for_each_mte_vma(current, vma)
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_data':
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:21: error: 'struct mm_struct' has no member named 'mmap'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                     ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:114:2: note: in expansion of macro 'for_each_mte_vma'
  114 |  for_each_mte_vma(current, vma) {
      |  ^~~~~~~~~~~~~~~~
/tmp/next/build/arch/arm64/kernel/elfcore.c:13:43: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |   for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
      |                                           ^~
/tmp/next/build/arch/arm64/kernel/elfcore.c:114:2: note: in expansion of macro 'for_each_mte_vma'
  114 |  for_each_mte_vma(current, vma) {
      |  ^~~~~~~~~~~~~~~~

I did not identify the commit which triggered this. I have used the
maple tree from 20220217 instead.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: linux-next: build failure after merge of the maple tree
  2022-02-17 19:24 ` Will Deacon
@ 2022-02-18  1:46   ` Liam Howlett
  0 siblings, 0 replies; 7+ messages in thread
From: Liam Howlett @ 2022-02-18  1:46 UTC (permalink / raw)
  To: Will Deacon
  Cc: Stephen Rothwell, Catalin Marinas, Linux Kernel Mailing List,
	Linux Next Mailing List

* Will Deacon <will@kernel.org> [220217 14:24]:
> On Thu, Feb 17, 2022 at 07:18:57PM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the maple tree, today's linux-next build (arm64 defconfig)
> > failed like this:
> > 
> > arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_phdrs':
> > arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                   ^~
> > arch/arm64/kernel/elfcore.c:69:9: note: in expansion of macro 'for_each_mte_vma'
> >    69 |         for_each_mte_vma(current, vma)
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                                         ^~
> > arch/arm64/kernel/elfcore.c:69:9: note: in expansion of macro 'for_each_mte_vma'
> >    69 |         for_each_mte_vma(current, vma)
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_phdrs':
> > arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                   ^~
> > arch/arm64/kernel/elfcore.c:79:9: note: in expansion of macro 'for_each_mte_vma'
> >    79 |         for_each_mte_vma(current, vma) {
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                                         ^~
> > arch/arm64/kernel/elfcore.c:79:9: note: in expansion of macro 'for_each_mte_vma'
> >    79 |         for_each_mte_vma(current, vma) {
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_data_size':
> > arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                   ^~
> > arch/arm64/kernel/elfcore.c:104:9: note: in expansion of macro 'for_each_mte_vma'
> >   104 |         for_each_mte_vma(current, vma)
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                                         ^~
> > arch/arm64/kernel/elfcore.c:104:9: note: in expansion of macro 'for_each_mte_vma'
> >   104 |         for_each_mte_vma(current, vma)
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_data':
> > arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                   ^~
> > arch/arm64/kernel/elfcore.c:114:9: note: in expansion of macro 'for_each_mte_vma'
> >   114 |         for_each_mte_vma(current, vma) {
> >       |         ^~~~~~~~~~~~~~~~
> > arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
> >    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
> >       |                                                         ^~
> > arch/arm64/kernel/elfcore.c:114:9: note: in expansion of macro 'for_each_mte_vma'
> >   114 |         for_each_mte_vma(current, vma) {
> >       |         ^~~~~~~~~~~~~~~~
> > 
> > Caused by commit
> > 
> >   b09e8361a4c3 ("mm: Remove the vma linked list")
> > 
> > interacting with commit
> > 
> >   6dd8b1a0b6cb ("arm64: mte: Dump the MTE tags in the core file")
> > 
> > from the arm64 tree.
> 
> Yikes, this is quite a mess. Liam -- how would you like to resolve this?

The removal of the vma linked list means tsk->mm->mmap and vma->vm_next
are no longer usable.  for_each_mte_vma() could be altered to take a vma
iterator:

#define for_each_mte_vma(vmi, vma)					\
	if (system_supports_mte())					\
		for_each_vma(vmi, vma)					\
			if (vma->vm_flags & VM_MTE)


Then used as such:
 VMA_ITERATOR(vmi, tsk->mm, 0);
...

for_each_mte_vma(vmi, vma) {
...
}

Where might I find a branch containing this patch?  Is it a stand alone
or part of a larger series?

Liam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: linux-next: build failure after merge of the maple tree
  2022-02-17  8:18 Stephen Rothwell
@ 2022-02-17 19:24 ` Will Deacon
  2022-02-18  1:46   ` Liam Howlett
  0 siblings, 1 reply; 7+ messages in thread
From: Will Deacon @ 2022-02-17 19:24 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Liam Howlett, Catalin Marinas, Linux Kernel Mailing List,
	Linux Next Mailing List

On Thu, Feb 17, 2022 at 07:18:57PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the maple tree, today's linux-next build (arm64 defconfig)
> failed like this:
> 
> arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_phdrs':
> arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                   ^~
> arch/arm64/kernel/elfcore.c:69:9: note: in expansion of macro 'for_each_mte_vma'
>    69 |         for_each_mte_vma(current, vma)
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                                         ^~
> arch/arm64/kernel/elfcore.c:69:9: note: in expansion of macro 'for_each_mte_vma'
>    69 |         for_each_mte_vma(current, vma)
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_phdrs':
> arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                   ^~
> arch/arm64/kernel/elfcore.c:79:9: note: in expansion of macro 'for_each_mte_vma'
>    79 |         for_each_mte_vma(current, vma) {
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                                         ^~
> arch/arm64/kernel/elfcore.c:79:9: note: in expansion of macro 'for_each_mte_vma'
>    79 |         for_each_mte_vma(current, vma) {
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_data_size':
> arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                   ^~
> arch/arm64/kernel/elfcore.c:104:9: note: in expansion of macro 'for_each_mte_vma'
>   104 |         for_each_mte_vma(current, vma)
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                                         ^~
> arch/arm64/kernel/elfcore.c:104:9: note: in expansion of macro 'for_each_mte_vma'
>   104 |         for_each_mte_vma(current, vma)
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_data':
> arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                   ^~
> arch/arm64/kernel/elfcore.c:114:9: note: in expansion of macro 'for_each_mte_vma'
>   114 |         for_each_mte_vma(current, vma) {
>       |         ^~~~~~~~~~~~~~~~
> arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
>    13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
>       |                                                         ^~
> arch/arm64/kernel/elfcore.c:114:9: note: in expansion of macro 'for_each_mte_vma'
>   114 |         for_each_mte_vma(current, vma) {
>       |         ^~~~~~~~~~~~~~~~
> 
> Caused by commit
> 
>   b09e8361a4c3 ("mm: Remove the vma linked list")
> 
> interacting with commit
> 
>   6dd8b1a0b6cb ("arm64: mte: Dump the MTE tags in the core file")
> 
> from the arm64 tree.

Yikes, this is quite a mess. Liam -- how would you like to resolve this?

Will

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: build failure after merge of the maple tree
@ 2022-02-17  8:18 Stephen Rothwell
  2022-02-17 19:24 ` Will Deacon
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2022-02-17  8:18 UTC (permalink / raw)
  To: Liam Howlett, Catalin Marinas, Will Deacon
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 6176 bytes --]

Hi all,

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

arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_phdrs':
arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                   ^~
arch/arm64/kernel/elfcore.c:69:9: note: in expansion of macro 'for_each_mte_vma'
   69 |         for_each_mte_vma(current, vma)
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                                         ^~
arch/arm64/kernel/elfcore.c:69:9: note: in expansion of macro 'for_each_mte_vma'
   69 |         for_each_mte_vma(current, vma)
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_phdrs':
arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                   ^~
arch/arm64/kernel/elfcore.c:79:9: note: in expansion of macro 'for_each_mte_vma'
   79 |         for_each_mte_vma(current, vma) {
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                                         ^~
arch/arm64/kernel/elfcore.c:79:9: note: in expansion of macro 'for_each_mte_vma'
   79 |         for_each_mte_vma(current, vma) {
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c: In function 'elf_core_extra_data_size':
arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                   ^~
arch/arm64/kernel/elfcore.c:104:9: note: in expansion of macro 'for_each_mte_vma'
  104 |         for_each_mte_vma(current, vma)
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                                         ^~
arch/arm64/kernel/elfcore.c:104:9: note: in expansion of macro 'for_each_mte_vma'
  104 |         for_each_mte_vma(current, vma)
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c: In function 'elf_core_write_extra_data':
arch/arm64/kernel/elfcore.c:13:35: error: 'struct mm_struct' has no member named 'mmap'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                   ^~
arch/arm64/kernel/elfcore.c:114:9: note: in expansion of macro 'for_each_mte_vma'
  114 |         for_each_mte_vma(current, vma) {
      |         ^~~~~~~~~~~~~~~~
arch/arm64/kernel/elfcore.c:13:57: error: 'struct vm_area_struct' has no member named 'vm_next'
   13 |                 for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)      \
      |                                                         ^~
arch/arm64/kernel/elfcore.c:114:9: note: in expansion of macro 'for_each_mte_vma'
  114 |         for_each_mte_vma(current, vma) {
      |         ^~~~~~~~~~~~~~~~

Caused by commit

  b09e8361a4c3 ("mm: Remove the vma linked list")

interacting with commit

  6dd8b1a0b6cb ("arm64: mte: Dump the MTE tags in the core file")

from the arm64 tree.

I have applied the following merge fix patch for today:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 17 Feb 2022 19:12:41 +1100
Subject: [PATCH] fix up for "arm64: mte: Dump the MTE tags in the core file"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/arm64/kernel/elfcore.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/elfcore.c b/arch/arm64/kernel/elfcore.c
index 3455ee4acc04..35f99088825e 100644
--- a/arch/arm64/kernel/elfcore.c
+++ b/arch/arm64/kernel/elfcore.c
@@ -8,9 +8,9 @@
 #include <asm/cpufeature.h>
 #include <asm/mte.h>
 
-#define for_each_mte_vma(tsk, vma)					\
+#define for_each_mte_vma(mas, vma)					\
 	if (system_supports_mte())					\
-		for (vma = tsk->mm->mmap; vma; vma = vma->vm_next)	\
+		mas_for_each(&mas, vma, ULONG_MAX)			\
 			if (vma->vm_flags & VM_MTE)
 
 static unsigned long mte_vma_tag_dump_size(struct vm_area_struct *vma)
@@ -64,9 +64,10 @@ static int mte_dump_tag_range(struct coredump_params *cprm,
 Elf_Half elf_core_extra_phdrs(void)
 {
 	struct vm_area_struct *vma;
+	MA_STATE(mas, &current->mm->mm_mt, 0, 0);
 	int vma_count = 0;
 
-	for_each_mte_vma(current, vma)
+	for_each_mte_vma(mas, vma)
 		vma_count++;
 
 	return vma_count;
@@ -75,8 +76,9 @@ Elf_Half elf_core_extra_phdrs(void)
 int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
 {
 	struct vm_area_struct *vma;
+	MA_STATE(mas, &current->mm->mm_mt, 0, 0);
 
-	for_each_mte_vma(current, vma) {
+	for_each_mte_vma(mas, vma) {
 		struct elf_phdr phdr;
 
 		phdr.p_type = PT_ARM_MEMTAG_MTE;
@@ -99,9 +101,10 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
 size_t elf_core_extra_data_size(void)
 {
 	struct vm_area_struct *vma;
+	MA_STATE(mas, &current->mm->mm_mt, 0, 0);
 	size_t data_size = 0;
 
-	for_each_mte_vma(current, vma)
+	for_each_mte_vma(mas, vma)
 		data_size += mte_vma_tag_dump_size(vma);
 
 	return data_size;
@@ -110,8 +113,9 @@ size_t elf_core_extra_data_size(void)
 int elf_core_write_extra_data(struct coredump_params *cprm)
 {
 	struct vm_area_struct *vma;
+	MA_STATE(mas, &current->mm->mm_mt, 0, 0);
 
-	for_each_mte_vma(current, vma) {
+	for_each_mte_vma(mas, vma) {
 		if (vma->vm_flags & VM_DONTDUMP)
 			continue;
 
-- 
2.34.1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-23  2:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17  8:27 linux-next: build failure after merge of the maple tree Stephen Rothwell
2022-02-18  2:14 ` Liam Howlett
  -- strict thread matches above, loose matches on Subject: below --
2022-02-23  0:45 broonie
2022-02-23  2:32 ` Liam Howlett
2022-02-17  8:18 Stephen Rothwell
2022-02-17 19:24 ` Will Deacon
2022-02-18  1:46   ` Liam Howlett

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).