Skip to content

Commit

Permalink
Revert "arm64: Change elfcore for_each_mte_vma() to use VMA iterator"
Browse files Browse the repository at this point in the history
This reverts commit 3a4f7ef.

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: Will Deacon <will@kernel.org>
  • Loading branch information
Will Deacon committed Apr 4, 2022
1 parent 3123109 commit a0ab7e5
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions arch/arm64/kernel/elfcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
#include <asm/cpufeature.h>
#include <asm/mte.h>

#ifndef VMA_ITERATOR
#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) \
#define for_each_mte_vma(tsk, vma) \
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)

static unsigned long mte_vma_tag_dump_size(struct vm_area_struct *vma)
Expand Down Expand Up @@ -72,9 +65,8 @@ 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(vmi, vma)
for_each_mte_vma(current, vma)
vma_count++;

return vma_count;
Expand All @@ -83,9 +75,8 @@ 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(vmi, vma) {
for_each_mte_vma(current, vma) {
struct elf_phdr phdr;

phdr.p_type = PT_ARM_MEMTAG_MTE;
Expand All @@ -109,9 +100,8 @@ 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(vmi, vma)
for_each_mte_vma(current, vma)
data_size += mte_vma_tag_dump_size(vma);

return data_size;
Expand All @@ -120,9 +110,8 @@ 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(vmi, vma) {
for_each_mte_vma(current, vma) {
if (vma->vm_flags & VM_DONTDUMP)
continue;

Expand Down

0 comments on commit a0ab7e5

Please sign in to comment.