From: Baoquan He <bhe@redhat.com>
To: Qiang Ma <maqianga@uniontech.com>
Cc: akpm@linux-foundation.org, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 3/4] kexec: print out debugging message if required for kexec_load
Date: Wed, 5 Nov 2025 16:55:28 +0800 [thread overview]
Message-ID: <aQsRADZ+pPho9pYa@MiWiFi-R3L-srv> (raw)
In-Reply-To: <2331A9F3E09581FC+4ab7e9ba-8776-47d2-868f-cb01ca9cd909@uniontech.com>
On 11/05/25 at 04:35pm, Qiang Ma wrote:
>
> 在 2025/11/5 15:53, Baoquan He 写道:
> > On 11/05/25 at 11:41am, Qiang Ma wrote:
> > > 在 2025/11/5 11:01, Baoquan He 写道:
> > > > On 11/03/25 at 02:34pm, Qiang Ma wrote:
> > > > > The commit a85ee18c7900 ("kexec_file: print out debugging message
> > > > > if required") has added general code printing in kexec_file_load(),
> > > > > but not in kexec_load().
> > > > >
> > > > > Especially in the RISC-V architecture, kexec_image_info() has been
> > > > > removed(commit eb7622d908a0 ("kexec_file, riscv: print out debugging
> > > > > message if required")). As a result, when using '-d' for the kexec_load
> > > > > interface, print nothing in the kernel space. This might be helpful for
> > > > > verifying the accuracy of the data passed to the kernel. Therefore,
> > > > > refer to this commit a85ee18c7900 ("kexec_file: print out debugging
> > > > > message if required"), debug print information has been added.
> > > > >
> > > > > Signed-off-by: Qiang Ma <maqianga@uniontech.com>
> > > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > > Closes: https://lore.kernel.org/oe-kbuild-all/202510310332.6XrLe70K-lkp@intel.com/
> > > > > ---
> > > > > kernel/kexec.c | 11 +++++++++++
> > > > > 1 file changed, 11 insertions(+)
> > > > >
> > > > > diff --git a/kernel/kexec.c b/kernel/kexec.c
> > > > > index c7a869d32f87..9b433b972cc1 100644
> > > > > --- a/kernel/kexec.c
> > > > > +++ b/kernel/kexec.c
> > > > > @@ -154,7 +154,15 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments,
> > > > > if (ret)
> > > > > goto out;
> > > > > + kexec_dprintk("nr_segments = %lu\n", nr_segments);
> > > > > for (i = 0; i < nr_segments; i++) {
> > > > > + struct kexec_segment *ksegment;
> > > > > +
> > > > > + ksegment = &image->segment[i];
> > > > > + kexec_dprintk("segment[%lu]: buf=0x%p bufsz=0x%zx mem=0x%lx memsz=0x%zx\n",
> > > > > + i, ksegment->buf, ksegment->bufsz, ksegment->mem,
> > > > > + ksegment->memsz);
> > > > There has already been a print_segments() in kexec-tools/kexec/kexec.c,
> > > > you will get duplicated printing. That sounds not good. Have you tested
> > > > this?
> > > I have tested it, kexec-tools is the debug message printed
> > > in user space, while kexec_dprintk is printed
> > > in kernel space.
> > >
> > > This might be helpful for verifying the accuracy of
> > > the data passed to the kernel.
> > Hmm, that's not necessary with a debug printing to verify value passed
> > in kernel. We should only add debug pringing when we need but lack it.
> > I didn't check it carefully, if you add the debug printing only for
> > verifying accuracy, that doesn't justify the code change.
> It's not entirely because of it.
>
> Another reason is that for RISC-V, for kexec_file_load interface,
> kexec_image_info() was deleted at that time because the content
> has been printed out in generic code.
>
> However, these contents were not printed in kexec_load because
> kexec_image_info was deleted. So now it has been added.
print_segments() in kexec-tools/kexec/kexec.c is a generic function,
shouldn't you make it called in kexec-tools for risc-v? I am confused by
the purpose of this patchset.
> > > > > +
> > > > > ret = kimage_load_segment(image, i);
> > > > > if (ret)
> > > > > goto out;
> > > > > @@ -166,6 +174,9 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments,
> > > > > if (ret)
> > > > > goto out;
> > > > > + kexec_dprintk("kexec_load: type:%u, start:0x%lx head:0x%lx flags:0x%lx\n",
> > > > > + image->type, image->start, image->head, flags);
> > > > > +
> > > > > /* Install the new kernel and uninstall the old */
> > > > > image = xchg(dest_image, image);
> > > > > --
> > > > > 2.20.1
> > > > >
> >
>
next prev parent reply other threads:[~2025-11-05 8:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 6:34 [PATCH v2 0/4] kexec: print out debugging message if required for kexec_load Qiang Ma
2025-11-03 6:34 ` [PATCH v2 1/4] kexec: Fix uninitialized struct kimage *image pointer Qiang Ma
2025-11-03 6:34 ` [PATCH v2 2/4] kexec: add kexec_core flag to control debug printing Qiang Ma
2025-11-05 3:09 ` Baoquan He
2025-11-05 4:32 ` Qiang Ma
2025-11-03 6:34 ` [PATCH v2 3/4] kexec: print out debugging message if required for kexec_load Qiang Ma
2025-11-05 3:01 ` Baoquan He
2025-11-05 3:41 ` Qiang Ma
2025-11-05 7:53 ` Baoquan He
2025-11-05 8:35 ` Qiang Ma
2025-11-05 8:55 ` Baoquan He [this message]
2025-11-05 11:28 ` Qiang Ma
2025-11-05 13:01 ` Baoquan He
2025-11-05 15:05 ` Qiang Ma
2025-11-05 8:48 ` Qiang Ma
2025-11-03 6:34 ` [PATCH v2 4/4] kexec_file: Fix the issue of mismatch between loop variable types Qiang Ma
2025-11-05 3:05 ` Baoquan He
2025-11-05 3:47 ` Qiang Ma
2025-11-05 6:56 ` Baoquan He
2025-11-05 7:06 ` Qiang Ma
[not found] ` <c669d240-1ee8-4897-a30d-3efefe161085@uniontech.com>
2025-11-05 4:31 ` Qiang Ma
-- strict thread matches above, loose matches on Subject: below --
2025-12-19 9:31 [PATCH v2 0/4] kexec: add kexec flag to control debug printing Qiang Ma
2025-12-19 9:31 ` [PATCH v2 3/4] kexec: print out debugging message if required for kexec_load Qiang Ma
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=aQsRADZ+pPho9pYa@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=maqianga@uniontech.com \
/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.