All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Suseendran Bhaskaran" <suseendranb@google.com>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org
Cc: "H . Peter Anvin" <hpa@zytor.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Baoquan He" <baoquan.he@linux.dev>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Eric DeVolder" <eric.devolder@oracle.com>,
	"Sourabh Jain" <sourabhjain@linux.ibm.com>,
	"Jinjie Ruan" <ruanjinjie@huawei.com>,
	"Ionut Nechita" <ionut.nechita@windriver.com>,
	"Greg Thelen" <gthelen@google.com>,
	kexec@lists.infradead.org
Subject: Re: [PATCH] x86/crash: Include Elf64_Ehdr and RAM ranges in elfcorehdr size
Date: Tue, 01 Dec 2026 17:28:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-243845@kernel.org> (raw)
In-Reply-To: <20261201172159.2671514-1-suseendranb@google.com>

> arch_crash_get_elfcorehdr_size() computes the size exported via
> /sys/kernel/kexec/crash_elfcorehdr_size for kexec_load() with crash
> hotplug support. Unlike crash_load_segments(), it omits both
> sizeof(Elf64_Ehdr) and the existing System RAM ranges when
> CONFIG_MEMORY_HOTPLUG is disabled.
> 
> With --hotplug, kexec-tools overrides the elfcorehdr segment memsz with
> this sysfs value and truncates bufsz if bufsz > memsz, so the loaded
> elfcorehdr can be silently truncated on CONFIG_MEMORY_HOTPLUG=n systems,
> and subsequent hotplug updates fail. For example, on a default
> CONFIG_NR_CPUS=64 kernel with CONFIG_MEMORY_HOTPLUG=n, 64 possible CPUs,
> and 10 System RAM ranges, crash_elfcorehdr_size reports 3696 bytes
> (memsz 4096) and CPU offline fails with:
> 
>   crash hp: update elfcorehdr elfsz 8192 > memsz 4096
> 
> Add arch_get_system_nr_ranges() when !IS_ENABLED(CONFIG_MEMORY_HOTPLUG)
> and include sizeof(Elf64_Ehdr) so arch_crash_get_elfcorehdr_size()
> matches crash_load_segments(). Tested with kexec-tools 2.0.32 in QEMU
> under the configuration above: crash_elfcorehdr_size reports 4488 bytes
> (memsz 8192) and CPU offline updates elfcorehdr cleanly.
> 
> Gemini assisted with code analysis and the QEMU reproducer. All changes
> and test results were reviewed by the author.
> 
> Fixes: a72bbec70da2 ("crash: hotplug support for kexec_load()")
> Signed-off-by: Suseendran Bhaskaran <suseendranb@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201172159.2671514-1-suseendranb@google.com?part=1


  reply	other threads:[~2026-12-01 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 17:21 [PATCH] x86/crash: Include Elf64_Ehdr and RAM ranges in elfcorehdr size Suseendran Bhaskaran
2026-12-01 17:28 ` sashiko-bot [this message]
2026-12-02  6:27 ` Jinjie Ruan

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=sashiko-outbox-243845@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=eric.devolder@oracle.com \
    --cc=gthelen@google.com \
    --cc=hpa@zytor.com \
    --cc=ionut.nechita@windriver.com \
    --cc=kexec@lists.infradead.org \
    --cc=mingo@redhat.com \
    --cc=rppt@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sourabhjain@linux.ibm.com \
    --cc=suseendranb@google.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.