diff options
author | Eric DeVolder <eric.devolder@oracle.com> | 2023-09-27 14:11:36 -0400 |
---|---|---|
committer | Simon Horman <horms@kernel.org> | 2023-10-04 14:04:48 +0200 |
commit | 118b567ce74af750535c5b77ab8c97b0e1a6b931 (patch) | |
tree | 80ff172b812ec329cb47f258b62c55ede8cac99b | |
parent | d59d17f372398d270f9d0f1aaf37f5ad1c4a601d (diff) | |
download | kexec-tools-118b567ce74af750535c5b77ab8c97b0e1a6b931.tar.gz |
crashdump/x86: set the elfcorehdr segment size for hotplug
For hotplug, the elfcorehdr segment must be sized appropriately
to allow a growing number of CPUs or memory regions. Use the size
reported by the kernel via /sys/kernel/crash_elfcorehdr_sz.
Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
Signed-off-by: Simon Horman <horms@kernel.org>
-rw-r--r-- | kexec/arch/i386/crashdump-x86.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index cb86ca71..a01031e5 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -957,6 +957,14 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, memsz = bufsz; } + /* For hotplug support, override the minimum necessary size just + * computed with the value from /sys/kernel/crash_elfcorehdr_size. + * Properly align the size as well. + */ + if (do_hotplug) { + memsz = _ALIGN(elfcorehdrsz, align); + } + /* Record the location of the elfcorehdr for hotplug handling */ info->elfcorehdr = elfcorehdr = add_buffer(info, tmp, bufsz, memsz, align, min_base, |