Commit a0ab7e5b authored by Will Deacon's avatar Will Deacon

Revert "arm64: Change elfcore for_each_mte_vma() to use VMA iterator"

This reverts commit 3a4f7ef4.

Revert this temporary bodge. It only existed to ease integration with
the maple tree work for the 5.18 merge window and that doesn't appear
to have landed in any case.
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 31231092
...@@ -8,16 +8,9 @@ ...@@ -8,16 +8,9 @@
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#include <asm/mte.h> #include <asm/mte.h>
#ifndef VMA_ITERATOR #define for_each_mte_vma(tsk, vma) \
#define VMA_ITERATOR(name, mm, addr) \
struct mm_struct *name = mm
#define for_each_vma(vmi, vma) \
for (vma = vmi->mmap; vma; vma = vma->vm_next)
#endif
#define for_each_mte_vma(vmi, vma) \
if (system_supports_mte()) \ if (system_supports_mte()) \
for_each_vma(vmi, vma) \ for (vma = tsk->mm->mmap; vma; vma = vma->vm_next) \
if (vma->vm_flags & VM_MTE) if (vma->vm_flags & VM_MTE)
static unsigned long mte_vma_tag_dump_size(struct vm_area_struct *vma) static unsigned long mte_vma_tag_dump_size(struct vm_area_struct *vma)
...@@ -72,9 +65,8 @@ Elf_Half elf_core_extra_phdrs(void) ...@@ -72,9 +65,8 @@ Elf_Half elf_core_extra_phdrs(void)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
int vma_count = 0; int vma_count = 0;
VMA_ITERATOR(vmi, current->mm, 0);
for_each_mte_vma(vmi, vma) for_each_mte_vma(current, vma)
vma_count++; vma_count++;
return vma_count; return vma_count;
...@@ -83,9 +75,8 @@ Elf_Half elf_core_extra_phdrs(void) ...@@ -83,9 +75,8 @@ Elf_Half elf_core_extra_phdrs(void)
int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
VMA_ITERATOR(vmi, current->mm, 0);
for_each_mte_vma(vmi, vma) { for_each_mte_vma(current, vma) {
struct elf_phdr phdr; struct elf_phdr phdr;
phdr.p_type = PT_ARM_MEMTAG_MTE; phdr.p_type = PT_ARM_MEMTAG_MTE;
...@@ -109,9 +100,8 @@ size_t elf_core_extra_data_size(void) ...@@ -109,9 +100,8 @@ size_t elf_core_extra_data_size(void)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
size_t data_size = 0; size_t data_size = 0;
VMA_ITERATOR(vmi, current->mm, 0);
for_each_mte_vma(vmi, vma) for_each_mte_vma(current, vma)
data_size += mte_vma_tag_dump_size(vma); data_size += mte_vma_tag_dump_size(vma);
return data_size; return data_size;
...@@ -120,9 +110,8 @@ size_t elf_core_extra_data_size(void) ...@@ -120,9 +110,8 @@ size_t elf_core_extra_data_size(void)
int elf_core_write_extra_data(struct coredump_params *cprm) int elf_core_write_extra_data(struct coredump_params *cprm)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
VMA_ITERATOR(vmi, current->mm, 0);
for_each_mte_vma(vmi, vma) { for_each_mte_vma(current, vma) {
if (vma->vm_flags & VM_DONTDUMP) if (vma->vm_flags & VM_DONTDUMP)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment