From: sashiko-bot@kernel.org
To: "Wandun Chen" <chenwandun1@gmail.com>,
robh@kernel.org, baoquan.he@linux.dev, rppt@kernel.org,
m.szyprowski@samsung.com
Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com,
chenhuacai@kernel.org, kernel@xen0n.name, pjw@kernel.org,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
saravanak@kernel.org, akpm@linux-foundation.org,
pasha.tatashin@soleen.com, pratyush@kernel.org,
ruirui.yang@linux.dev, robin.murphy@arm.com,
devicetree@vger.kernel.org, kexec@lists.infradead.org,
conor+dt@kernel.org
Subject: Re: [RESEND PATCH v8 7/8] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP
Date: Fri, 16 Oct 2026 06:32:40 +0000 [thread overview]
Message-ID: <sashiko-outbox-173868@kernel.org> (raw)
In-Reply-To: <20261016061549.4181390-8-chenwandun1@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] of: fdt: boot panic on sh due to memblock_mark_nodump splitting before resize
--
commit c3780e76cb8942c20c5a5a3858d45f390651c1c3
Author: Wandun Chen <chenwandun@lixiang.com>
of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP
Mark non-dumpable reserved-memory regions with MEMBLOCK_NODUMP so
kdump can omit them from the vmcore.
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index ecc9231026224..a5f223a74b7ea 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1285,6 +1285,7 @@ void __init unflatten_device_tree(void)
>
> /* Save the statically-placed regions in the reserved_mem array */
> fdt_scan_reserved_mem_late();
> + fdt_mark_reserve_mem_nodump();
[Severity: High]
Could this cause a boot panic on architectures like sh that call
unflatten_device_tree() before memblock resizing is allowed?
On the sh architecture, unflatten_device_tree() is called prior to
paging_init():
arch/sh/kernel/setup.c:setup_arch() {
...
#ifdef CONFIG_BUILTIN_DTB
unflatten_and_copy_device_tree();
#else
unflatten_device_tree();
#endif
paging_init();
...
}
Dynamic resizing of the memblock array is only enabled during paging_init():
arch/sh/mm/init.c:paging_init() {
...
memblock_enforce_memory_limit(memory_limit);
memblock_allow_resize();
...
}
Since fdt_mark_reserve_mem_nodump() applies MEMBLOCK_NODUMP flags,
it forces memblock.memory regions to be split. Because memblock_can_resize
is 0 at this early stage, if the device tree specifies enough non-dumpable
reserved memory regions to exceed INIT_MEMBLOCK_MEMORY_REGIONS,
memblock_double_array() will unconditionally panic the kernel during early
boot.
>
> /* Populate an empty root node when bootloader doesn't provide one */
> if (!fdt) {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016061549.4181390-1-chenwandun1@gmail.com?part=7
next prev parent reply other threads:[~2026-10-16 6:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 6:15 [RESEND PATCH v8 0/8] kdump: reduce vmcore size and capture time Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 1/8] riscv: build crash_mem ranges from memblock instead of resource tree Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 2/8] crash_core: fold duplicated memblock arch hooks into the weak default Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 3/8] crash_core: serialize crash header preparation against hotplug Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 4/8] crash_core: replace for_each_mem_range() with for_each_mem_region() Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 5/8] memblock: introduce MEMBLOCK_NODUMP flag Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 6/8] of: reserved_mem: add dumpable flag to opt-in vmcore Wandun Chen
2026-10-16 6:15 ` [RESEND PATCH v8 7/8] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP Wandun Chen
2026-10-16 6:32 ` sashiko-bot [this message]
2026-10-16 6:15 ` [RESEND PATCH v8 8/8] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header Wandun Chen
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-173868@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=baoquan.he@linux.dev \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=chenwandun1@gmail.com \
--cc=conor+dt@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=hpa@zytor.com \
--cc=kernel@xen0n.name \
--cc=kexec@lists.infradead.org \
--cc=m.szyprowski@samsung.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=palmer@dabbelt.com \
--cc=pasha.tatashin@soleen.com \
--cc=pjw@kernel.org \
--cc=pratyush@kernel.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
--cc=saravanak@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tglx@kernel.org \
--cc=will@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox