All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Howlett <liam.howlett@oracle.com>
To: "broonie@kernel.org" <broonie@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Subject: Re: linux-next: build failure after merge of the maple tree
Date: Wed, 23 Feb 2022 02:32:55 +0000	[thread overview]
Message-ID: <20220223023245.uicyzttakfq3k5zf@revolver> (raw)
In-Reply-To: <20220223004525.2034065-1-broonie@kernel.org>

* 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

  reply	other threads:[~2022-02-23  2:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23  0:45 linux-next: build failure after merge of the maple tree broonie
2022-02-23  2:32 ` Liam Howlett [this message]
2022-02-23 12:47   ` [PATCH] arm64: Change elfcore for_each_mte_vma() to use VMA iterator kernel test robot
2022-02-23 13:08   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-02-17  8:27 linux-next: build failure after merge of the maple tree Stephen Rothwell
2022-02-18  2:14 ` Liam Howlett
2022-02-17  8:18 Stephen Rothwell
2022-02-17 19:24 ` Will Deacon
2022-02-18  1:46   ` Liam Howlett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223023245.uicyzttakfq3k5zf@revolver \
    --to=liam.howlett@oracle.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.