From: Eric DeVolder <eric.devolder@oracle.com>
To: kexec@lists.infradead.org
Cc: boris.ostrovsky@oracle.com, eric.devolder@oracle.com
Subject: [PATCH v1 7/7] crashdump/x86: utilize get_elfcorehdrsz()
Date: Thu, 20 Oct 2022 13:03:44 -0400 [thread overview]
Message-ID: <20221020170344.1962-8-eric.devolder@oracle.com> (raw)
In-Reply-To: <20221020170344.1962-1-eric.devolder@oracle.com>
Call get_elfcorehdrsz() to obtain the size of the elfcorehdr
buffer.
Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
---
kexec/arch/i386/crashdump-x86.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index cb86ca7..29d4ba5 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -957,6 +957,12 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
memsz = bufsz;
}
+ /* Adjust size of buffer according to hotplug and user */
+ sz = get_elfcorehdrsz(&elf_info, bufsz, CRASH_MAX_MEMORY_RANGES);
+ if (sz > memsz)
+ memsz = sz;
+ memsz = _ALIGN(memsz, align);
+
/* Record the location of the elfcorehdr for hotplug handling */
info->elfcorehdr =
elfcorehdr = add_buffer(info, tmp, bufsz, memsz, align, min_base,
--
2.31.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2022-10-20 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 17:03 [PATCH v1 0/7] crashdump: Kernel handling of CPU and memory hot un/plug Eric DeVolder
2022-10-20 17:03 ` [PATCH v1 1/7] crashdump: introduce the --hotplug option Eric DeVolder
2022-10-20 17:03 ` [PATCH v1 2/7] crashdump: exclude elfcorehdr segment from digest for hotplug Eric DeVolder
2022-10-20 17:03 ` [PATCH v1 3/7] crashdump/x86: identify elfcorehdr segment " Eric DeVolder
2022-10-20 17:03 ` [PATCH v1 4/7] kexec: create get_nr_cpus() Eric DeVolder
2022-10-20 17:03 ` [PATCH v1 5/7] crashdump: introduce --elfcorehdrsz option Eric DeVolder
2022-10-20 17:03 ` [PATCH v1 6/7] crashdump: create get_elfcorehdrsz() Eric DeVolder
2022-10-20 17:03 ` Eric DeVolder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221020170344.1962-8-eric.devolder@oracle.com \
--to=eric.devolder@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox