From: Simon Horman <horms@kernel.org>
To: hu.shengming@zte.com.cn
Cc: kexec@lists.infradead.org, luo.haiyang@zte.com.cn,
zhang.run@zte.com.cn, yang.tao172@zte.com.cn
Subject: Re: [PATCH 3/3] RISC-V: add bss section to kernel text elf header
Date: Wed, 20 May 2026 10:30:10 +0100 [thread overview]
Message-ID: <20260520093010.GA296581@horms.kernel.org> (raw)
In-Reply-To: <20260520153520587dSDah6BTNL9aPVMV_nsAo@zte.com.cn>
On Wed, May 20, 2026 at 03:35:20PM +0800, hu.shengming@zte.com.cn wrote:
> horms@kernel.org wrote:
> > On Mon, May 18, 2026 at 03:01:40PM +0800, hu.shengming@zte.com.cn wrote:
> > > From: Luo Haiyang <luo.haiyang@zte.com.cn>
> > >
> > > The kdump service reported the following error:
> > >
> > > No program header covering vaddr 0xffffffff819fa200 found kexec bug?
> > > saving vmcore-dmesg.txt failed
> > >
> > > prb stores the address of printk_rb_dynamic. Since printk_rb_dynamic
> > > resides in the bss segment and the PHDR (Program Header) does not include
> > > the bss segment address. Therefore, add the bss segment to the Kernel text.
> > >
> > > Signed-off-by: Luo Haiyang <luo.haiyang@zte.com.cn>
> >
> > Hi,
> >
> > I am wondering if to_be_excluded() also needs to be updated.
> > And, if so, should that change also be made for ARM64.
> >
> > Review assisted by gemini-3-pro-preview
>
> Thanks for taking a look.
>
> On arm64, the kernel code contains text and rodata section, and the kernel data
> contains data and bss section. Therefore, the arm64 architecture does not have
> a similar issue.
>
> Yes, on RISC-V, the to_be_excluded function does not properly handle the kernel
> memory range, it is still being excluded.
>
> cat /proc/iomem | grep Kernel
> 878a02000-87a8426e7 : Kernel image
> 878a02000-87944d309 : Kernel code
> 879c00000-87a1fffff : Kernel rodata
> 87a400000-87a7741ff : Kernel data
> 87a775000-87a8426e7 : Kernel bss
>
> Maybe we can directly use the kernel image in iomem_range_callback, and only the
> reserved memory needs to be excluded, like this:
>
> static int iomem_range_callback(...)
> {
> ....
> else if (!strncmp(str, KERNEL_IMAGE, strlen(KERNEL_IMAGE))) {
> elf_info.kern_paddr_start = base;
> elf_info.kern_size = length;
> }
>
> return 0;
> }
>
> static bool to_be_excluded(...)
> {
> ...
> if (!strncmp(str, IOMEM_RESERVED, strlen(IOMEM_RESERVED)))
> return true;
>
> return false;
> }
>
> If you think this change is acceptable, I will resubmit patch v3 later.
Thanks, sounds good to me.
prev parent reply other threads:[~2026-05-20 9:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 6:57 [PATCH v2 0/3] kexec-tool:bug fix for crashdump load on riscv hu.shengming
2026-05-18 6:59 ` [PATCH 1/3] RISC-V: fix crashdump load memory ranges hu.shengming
2026-05-18 7:00 ` [PATCH 2/3] RISCV: Fix incorrect virtual address translation in crashdump load hu.shengming
2026-05-18 7:01 ` [PATCH 3/3] RISC-V: add bss section to kernel text elf header hu.shengming
2026-05-19 12:44 ` Simon Horman
2026-05-20 7:35 ` hu.shengming
2026-05-20 9:30 ` Simon Horman [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=20260520093010.GA296581@horms.kernel.org \
--to=horms@kernel.org \
--cc=hu.shengming@zte.com.cn \
--cc=kexec@lists.infradead.org \
--cc=luo.haiyang@zte.com.cn \
--cc=yang.tao172@zte.com.cn \
--cc=zhang.run@zte.com.cn \
/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