Skip to content

Commit

Permalink
kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP
Browse files Browse the repository at this point in the history
struct crash_mem defined under include/linux/crash_core.h represents
a list of memory ranges. While it is used to represent memory ranges
for kdump kernel, it can also be used for other kind of memory ranges.
In fact, KEXEC_FILE_LOAD syscall in powerpc uses this structure to
represent reserved memory ranges and exclude memory ranges needed to
find the right memory regions to load kexec kernel. So, make the
definition of crash_mem structure available for !CONFIG_CRASH_DUMP
case too.

Signed-off-by: Hari Bathini <[email protected]>
Acked-by: Baoquan He <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/[email protected]
  • Loading branch information
hbathini authored and mpe committed Mar 17, 2024
1 parent 78cb094 commit 56a34d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/linux/crash_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

struct kimage;

struct crash_mem {
unsigned int max_nr_ranges;
unsigned int nr_ranges;
struct range ranges[] __counted_by(max_nr_ranges);
};

#ifdef CONFIG_CRASH_DUMP

int crash_shrink_memory(unsigned long new_size);
Expand Down Expand Up @@ -51,12 +57,6 @@ static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; }
/* Alignment required for elf header segment */
#define ELF_CORE_HEADER_ALIGN 4096

struct crash_mem {
unsigned int max_nr_ranges;
unsigned int nr_ranges;
struct range ranges[] __counted_by(max_nr_ranges);
};

extern int crash_exclude_mem_range(struct crash_mem *mem,
unsigned long long mstart,
unsigned long long mend);
Expand Down

0 comments on commit 56a34d7

Please sign in to comment.