Skip to content

Commit 56a34d7

Browse files
hbathinimpe
authored andcommitted
kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP
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 <hbathini@linux.ibm.com> Acked-by: Baoquan He <bhe@redhat.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240226103010.589537-2-hbathini@linux.ibm.com
1 parent 78cb094 commit 56a34d7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/linux/crash_core.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
struct kimage;
1010

11+
struct crash_mem {
12+
unsigned int max_nr_ranges;
13+
unsigned int nr_ranges;
14+
struct range ranges[] __counted_by(max_nr_ranges);
15+
};
16+
1117
#ifdef CONFIG_CRASH_DUMP
1218

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

54-
struct crash_mem {
55-
unsigned int max_nr_ranges;
56-
unsigned int nr_ranges;
57-
struct range ranges[] __counted_by(max_nr_ranges);
58-
};
59-
6060
extern int crash_exclude_mem_range(struct crash_mem *mem,
6161
unsigned long long mstart,
6262
unsigned long long mend);

0 commit comments

Comments
 (0)