From: Liam Howlett <liam.howlett@oracle•com>
To: Will Deacon <will@kernel•org>, Stephen Rothwell <sfr@canb•auug.org.au>
Cc: Catalin Marinas <catalin.marinas@arm•com>,
Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: [PATCH] arm64: Change elfcore for_each_mte_vma() to use VMA iterator
Date: Fri, 18 Feb 2022 02:37:04 +0000 [thread overview]
Message-ID: <20220218023650.672072-1-Liam.Howlett@oracle.com> (raw)
In-Reply-To: <20220218014642.lop2ohx4ov6fekyl@revolver>
This is an untested fix for the merge conflict of maple tree next and
arm64 next.
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
next prev parent reply other threads:[~2022-02-18 2:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 8:18 linux-next: build failure after merge of the maple tree Stephen Rothwell
2022-02-17 19:24 ` Will Deacon
2022-02-18 1:46 ` Liam Howlett
2022-02-18 2:37 ` Liam Howlett [this message]
2022-02-21 18:06 ` [PATCH] arm64: Change elfcore for_each_mte_vma() to use VMA iterator Catalin Marinas
2022-02-22 14:26 ` Liam Howlett
2022-02-22 16:20 ` Will Deacon
2022-02-22 17:26 ` Catalin Marinas
2022-02-22 18:54 ` Liam Howlett
2022-02-23 9:39 ` Catalin Marinas
2022-02-23 13:57 ` Liam Howlett
2022-02-23 11:37 ` Catalin Marinas
2022-02-23 14:11 ` Liam Howlett
2022-02-24 2:00 ` Liam Howlett
2022-02-25 15:50 ` Will Deacon
-- strict thread matches above, loose matches on Subject: below --
2022-02-23 2:32 linux-next: build failure after merge of the maple tree Liam Howlett
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
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=20220218023650.672072-1-Liam.Howlett@oracle.com \
--to=liam.howlett@oracle$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox