include/linux/kexec.h | 9 +++++---- include/uapi/linux/kexec.h | 1 + kernel/kexec.c | 8 +++++++- kernel/kexec_core.c | 4 +++- kernel/kexec_file.c | 4 +--- 5 files changed, 17 insertions(+), 9 deletions(-)
Overview:
=========
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().
Since kexec_load and kexec_file_load are not triggered simultaneously,
we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
Next, we need to do some things in this patchset:
1. rename kexec_file_dbg_print to kexec_dbg_print
2. Add KEXEC_DEBUG
3. Initialize kexec_dbg_print for kexec
4. Fix uninitialized struct kimage *image pointer
5. Set the reset of kexec_dbg_print to kimage_free
Testing:
=========
I did testing on x86_64, arm64 and loongarch. On x86_64, the printed messages
look like below:
unset CONFIG_KEXEC_FILE:
[ 81.502374] kexec: kexec_load: type:0, start:0x23fff7700 head:0x10a4b9002 flags:0x3e0010
set CONFIG_KEXEC_FILE
[ 36.774228] kexec_file: kernel: 0000000066c386c8 kernel_size: 0xd78400
[ 36.821814] kexec-bzImage64: Loaded purgatory at 0x23fffb000
[ 36.821826] kexec-bzImage64: Loaded boot_param, command line and misc at 0x23fff9000 bufsz=0x12d0 memsz=0x2000
[ 36.821829] kexec-bzImage64: Loaded 64bit kernel at 0x23d400000 bufsz=0xd73400 memsz=0x2ab7000
[ 36.821918] kexec-bzImage64: Loaded initrd at 0x23bd0b000 bufsz=0x16f40a8 memsz=0x16f40a8
[ 36.821920] kexec-bzImage64: Final command line is: root=/dev/mapper/test-root crashkernel=auto rd.lvm.lv=test/root
[ 36.821925] kexec-bzImage64: E820 memmap:
[ 36.821926] kexec-bzImage64: 0000000000000000-000000000009ffff (1)
[ 36.821928] kexec-bzImage64: 0000000000100000-0000000000811fff (1)
[ 36.821930] kexec-bzImage64: 0000000000812000-0000000000812fff (2)
[ 36.821931] kexec-bzImage64: 0000000000813000-00000000bee38fff (1)
[ 36.821933] kexec-bzImage64: 00000000bee39000-00000000beec2fff (2)
[ 36.821934] kexec-bzImage64: 00000000beec3000-00000000bf8ecfff (1)
[ 36.821935] kexec-bzImage64: 00000000bf8ed000-00000000bfb6cfff (2)
[ 36.821936] kexec-bzImage64: 00000000bfb6d000-00000000bfb7efff (3)
[ 36.821937] kexec-bzImage64: 00000000bfb7f000-00000000bfbfefff (4)
[ 36.821938] kexec-bzImage64: 00000000bfbff000-00000000bff7bfff (1)
[ 36.821939] kexec-bzImage64: 00000000bff7c000-00000000bfffffff (2)
[ 36.821940] kexec-bzImage64: 00000000feffc000-00000000feffffff (2)
[ 36.821941] kexec-bzImage64: 00000000ffc00000-00000000ffffffff (2)
[ 36.821942] kexec-bzImage64: 0000000100000000-000000023fffffff (1)
[ 36.872348] kexec_file: nr_segments = 4
[ 36.872356] kexec_file: segment[0]: buf=0x000000005314ece7 bufsz=0x4000 mem=0x23fffb000 memsz=0x5000
[ 36.872370] kexec_file: segment[1]: buf=0x000000006e59b143 bufsz=0x12d0 mem=0x23fff9000 memsz=0x2000
[ 36.872374] kexec_file: segment[2]: buf=0x00000000eb7b1fc3 bufsz=0xd73400 mem=0x23d400000 memsz=0x2ab7000
[ 36.882172] kexec_file: segment[3]: buf=0x000000006af76441 bufsz=0x16f40a8 mem=0x23bd0b000 memsz=0x16f5000
[ 36.889113] kexec_file: kexec_file_load: type:0, start:0x23fffb150 head:0x101a2e002 flags:0x8
Changes in v3:
==========
- Rename kexec_core_dbg_print to kexec_dbg_print
- Remove unnecessary segments prints
- Remove patch "kexec_file: Fix the issue of mismatch between loop variable types"
Qiang Ma (3):
kexec: Fix uninitialized struct kimage *image pointer
kexec: add kexec flag to control debug printing
kexec: print out debugging message if required for kexec_load
include/linux/kexec.h | 9 +++++----
include/uapi/linux/kexec.h | 1 +
kernel/kexec.c | 8 +++++++-
kernel/kexec_core.c | 4 +++-
kernel/kexec_file.c | 4 +---
5 files changed, 17 insertions(+), 9 deletions(-)
--
2.20.1
Hello All,
Do we have plan to support KEXEC_DEBUG flag?
Because upstream kexec-tools already added support for KEXEC_DEBUG flag
and that breaks the kexec_load with -d option.
- kexec: add kexec flag to support debug printing
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=71d6fd99af7e
Thanks,
Sourabh Jain
On 26/11/25 14:14, Qiang Ma wrote:
> Overview:
> =========
> 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().
>
> Since kexec_load and kexec_file_load are not triggered simultaneously,
> we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
>
> Next, we need to do some things in this patchset:
>
> 1. rename kexec_file_dbg_print to kexec_dbg_print
> 2. Add KEXEC_DEBUG
> 3. Initialize kexec_dbg_print for kexec
> 4. Fix uninitialized struct kimage *image pointer
> 5. Set the reset of kexec_dbg_print to kimage_free
>
> Testing:
> =========
> I did testing on x86_64, arm64 and loongarch. On x86_64, the printed messages
> look like below:
>
> unset CONFIG_KEXEC_FILE:
> [ 81.502374] kexec: kexec_load: type:0, start:0x23fff7700 head:0x10a4b9002 flags:0x3e0010
>
> set CONFIG_KEXEC_FILE
> [ 36.774228] kexec_file: kernel: 0000000066c386c8 kernel_size: 0xd78400
> [ 36.821814] kexec-bzImage64: Loaded purgatory at 0x23fffb000
> [ 36.821826] kexec-bzImage64: Loaded boot_param, command line and misc at 0x23fff9000 bufsz=0x12d0 memsz=0x2000
> [ 36.821829] kexec-bzImage64: Loaded 64bit kernel at 0x23d400000 bufsz=0xd73400 memsz=0x2ab7000
> [ 36.821918] kexec-bzImage64: Loaded initrd at 0x23bd0b000 bufsz=0x16f40a8 memsz=0x16f40a8
> [ 36.821920] kexec-bzImage64: Final command line is: root=/dev/mapper/test-root crashkernel=auto rd.lvm.lv=test/root
> [ 36.821925] kexec-bzImage64: E820 memmap:
> [ 36.821926] kexec-bzImage64: 0000000000000000-000000000009ffff (1)
> [ 36.821928] kexec-bzImage64: 0000000000100000-0000000000811fff (1)
> [ 36.821930] kexec-bzImage64: 0000000000812000-0000000000812fff (2)
> [ 36.821931] kexec-bzImage64: 0000000000813000-00000000bee38fff (1)
> [ 36.821933] kexec-bzImage64: 00000000bee39000-00000000beec2fff (2)
> [ 36.821934] kexec-bzImage64: 00000000beec3000-00000000bf8ecfff (1)
> [ 36.821935] kexec-bzImage64: 00000000bf8ed000-00000000bfb6cfff (2)
> [ 36.821936] kexec-bzImage64: 00000000bfb6d000-00000000bfb7efff (3)
> [ 36.821937] kexec-bzImage64: 00000000bfb7f000-00000000bfbfefff (4)
> [ 36.821938] kexec-bzImage64: 00000000bfbff000-00000000bff7bfff (1)
> [ 36.821939] kexec-bzImage64: 00000000bff7c000-00000000bfffffff (2)
> [ 36.821940] kexec-bzImage64: 00000000feffc000-00000000feffffff (2)
> [ 36.821941] kexec-bzImage64: 00000000ffc00000-00000000ffffffff (2)
> [ 36.821942] kexec-bzImage64: 0000000100000000-000000023fffffff (1)
> [ 36.872348] kexec_file: nr_segments = 4
> [ 36.872356] kexec_file: segment[0]: buf=0x000000005314ece7 bufsz=0x4000 mem=0x23fffb000 memsz=0x5000
> [ 36.872370] kexec_file: segment[1]: buf=0x000000006e59b143 bufsz=0x12d0 mem=0x23fff9000 memsz=0x2000
> [ 36.872374] kexec_file: segment[2]: buf=0x00000000eb7b1fc3 bufsz=0xd73400 mem=0x23d400000 memsz=0x2ab7000
> [ 36.882172] kexec_file: segment[3]: buf=0x000000006af76441 bufsz=0x16f40a8 mem=0x23bd0b000 memsz=0x16f5000
> [ 36.889113] kexec_file: kexec_file_load: type:0, start:0x23fffb150 head:0x101a2e002 flags:0x8
>
> Changes in v3:
> ==========
> - Rename kexec_core_dbg_print to kexec_dbg_print
> - Remove unnecessary segments prints
> - Remove patch "kexec_file: Fix the issue of mismatch between loop variable types"
>
> Qiang Ma (3):
> kexec: Fix uninitialized struct kimage *image pointer
> kexec: add kexec flag to control debug printing
> kexec: print out debugging message if required for kexec_load
>
> include/linux/kexec.h | 9 +++++----
> include/uapi/linux/kexec.h | 1 +
> kernel/kexec.c | 8 +++++++-
> kernel/kexec_core.c | 4 +++-
> kernel/kexec_file.c | 4 +---
> 5 files changed, 17 insertions(+), 9 deletions(-)
>
On 11/27/25 at 05:31pm, Sourabh Jain wrote: > Hello All, > > Do we have plan to support KEXEC_DEBUG flag? > > Because upstream kexec-tools already added support for KEXEC_DEBUG flag > and that breaks the kexec_load with -d option. > > - kexec: add kexec flag to support debug printing > https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=71d6fd99af7e I think we should revert that kexec-tools commit. This whole patchset is non-sense. Because of my carelessness, that userspace patch was merged. Hi Sourabh, Could you go through this patchset and help check if they are really needed? I can't find anything to convince myself. Thanks.
Hello Baoquan, On 27/11/25 21:00, Baoquan He wrote: > On 11/27/25 at 05:31pm, Sourabh Jain wrote: >> Hello All, >> >> Do we have plan to support KEXEC_DEBUG flag? >> >> Because upstream kexec-tools already added support for KEXEC_DEBUG flag >> and that breaks the kexec_load with -d option. >> >> - kexec: add kexec flag to support debug printing >> https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=71d6fd99af7e > I think we should revert that kexec-tools commit. Yeah, userspace changes shouldn't go in until the kernel patches are finalized. It seems that there are disagreements regarding the approach and usefulness of this patch series, so reverting the kexec-tools patch might be the right thing to avoid breaking anything for now. I have one question: should the kernel advertise KEXEC_DEBUG so that backward compatibility can be maintained between the kernel and kexec-tools? Or is that too much for a debugging flag? How was backward compatibility handled when we added the KEXEC_FILE_DEBUG flag? > This whole patchset is > non-sense. Because of my carelessness, that userspace patch was merged. > > Hi Sourabh, > > Could you go through this patchset and help check if they are really > needed? I can't find anything to convince myself. Thanks. Sure I will review this patch series. Thanks, Sourabh Jain
On 11/28/25 at 03:11pm, Sourabh Jain wrote: > Hello Baoquan, > > On 27/11/25 21:00, Baoquan He wrote: > > On 11/27/25 at 05:31pm, Sourabh Jain wrote: > > > Hello All, > > > > > > Do we have plan to support KEXEC_DEBUG flag? > > > > > > Because upstream kexec-tools already added support for KEXEC_DEBUG flag > > > and that breaks the kexec_load with -d option. > > > > > > - kexec: add kexec flag to support debug printing > > > https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=71d6fd99af7e > > I think we should revert that kexec-tools commit. > > Yeah, userspace changes shouldn't go in until the kernel patches are > finalized. It seems that there are disagreements regarding the approach > and usefulness of this patch series, so reverting the kexec-tools patch > might be the right thing to avoid breaking anything for now. The patch 1 is issue fixing, that is a good one. While patch 2, 3 are trying to add debugging printing for kexec_load interface which I think is not needed. I added debugging printing for kexec_file_load because I has been using 'kexec -d' to debug for kexec_load while kexec_file_load didn't have. So I mimicked kexec_load's debugging printing to add one for kexec_file_load. Now patch 2,3's adding doesn't make sense as he said he is doing for future need. > > I have one question: should the kernel advertise KEXEC_DEBUG so that > backward compatibility can be maintained between the kernel and > kexec-tools? Or is that too much for a debugging flag? How was backward > compatibility handled when we added the KEXEC_FILE_DEBUG flag? When I added KEXEC_FILE_DEBUG, I didn't consider backward compatibility. That is making the then latest kernel match the then latest kexec-tools. > > > This whole patchset is > > non-sense. Because of my carelessness, that userspace patch was merged. > > > > Hi Sourabh, > > > > Could you go through this patchset and help check if they are really > > needed? I can't find anything to convince myself. Thanks. > > Sure I will review this patch series. Thanks. Please check patch 2,3 to see if we really need the debugging printing for kexec_load, or its adding really brings benefit even if it's a little bit compared with the mess it brings; and if my objecting is too subjective. Thanks Baoquan
Hi,
On 11/26/25 at 04:44pm, Qiang Ma wrote:
> Overview:
> =========
> 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().
>
> Since kexec_load and kexec_file_load are not triggered simultaneously,
> we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
As I said in your last post, this is not needed at all, you just add a
not needed thing to kernel.
So NACK this patchset, unless you have reason to justify it. Sorry about
it.
Thanks
Baoquan
>
> Next, we need to do some things in this patchset:
>
> 1. rename kexec_file_dbg_print to kexec_dbg_print
> 2. Add KEXEC_DEBUG
> 3. Initialize kexec_dbg_print for kexec
> 4. Fix uninitialized struct kimage *image pointer
> 5. Set the reset of kexec_dbg_print to kimage_free
>
> Testing:
> =========
> I did testing on x86_64, arm64 and loongarch. On x86_64, the printed messages
> look like below:
>
> unset CONFIG_KEXEC_FILE:
> [ 81.502374] kexec: kexec_load: type:0, start:0x23fff7700 head:0x10a4b9002 flags:0x3e0010
>
> set CONFIG_KEXEC_FILE
> [ 36.774228] kexec_file: kernel: 0000000066c386c8 kernel_size: 0xd78400
> [ 36.821814] kexec-bzImage64: Loaded purgatory at 0x23fffb000
> [ 36.821826] kexec-bzImage64: Loaded boot_param, command line and misc at 0x23fff9000 bufsz=0x12d0 memsz=0x2000
> [ 36.821829] kexec-bzImage64: Loaded 64bit kernel at 0x23d400000 bufsz=0xd73400 memsz=0x2ab7000
> [ 36.821918] kexec-bzImage64: Loaded initrd at 0x23bd0b000 bufsz=0x16f40a8 memsz=0x16f40a8
> [ 36.821920] kexec-bzImage64: Final command line is: root=/dev/mapper/test-root crashkernel=auto rd.lvm.lv=test/root
> [ 36.821925] kexec-bzImage64: E820 memmap:
> [ 36.821926] kexec-bzImage64: 0000000000000000-000000000009ffff (1)
> [ 36.821928] kexec-bzImage64: 0000000000100000-0000000000811fff (1)
> [ 36.821930] kexec-bzImage64: 0000000000812000-0000000000812fff (2)
> [ 36.821931] kexec-bzImage64: 0000000000813000-00000000bee38fff (1)
> [ 36.821933] kexec-bzImage64: 00000000bee39000-00000000beec2fff (2)
> [ 36.821934] kexec-bzImage64: 00000000beec3000-00000000bf8ecfff (1)
> [ 36.821935] kexec-bzImage64: 00000000bf8ed000-00000000bfb6cfff (2)
> [ 36.821936] kexec-bzImage64: 00000000bfb6d000-00000000bfb7efff (3)
> [ 36.821937] kexec-bzImage64: 00000000bfb7f000-00000000bfbfefff (4)
> [ 36.821938] kexec-bzImage64: 00000000bfbff000-00000000bff7bfff (1)
> [ 36.821939] kexec-bzImage64: 00000000bff7c000-00000000bfffffff (2)
> [ 36.821940] kexec-bzImage64: 00000000feffc000-00000000feffffff (2)
> [ 36.821941] kexec-bzImage64: 00000000ffc00000-00000000ffffffff (2)
> [ 36.821942] kexec-bzImage64: 0000000100000000-000000023fffffff (1)
> [ 36.872348] kexec_file: nr_segments = 4
> [ 36.872356] kexec_file: segment[0]: buf=0x000000005314ece7 bufsz=0x4000 mem=0x23fffb000 memsz=0x5000
> [ 36.872370] kexec_file: segment[1]: buf=0x000000006e59b143 bufsz=0x12d0 mem=0x23fff9000 memsz=0x2000
> [ 36.872374] kexec_file: segment[2]: buf=0x00000000eb7b1fc3 bufsz=0xd73400 mem=0x23d400000 memsz=0x2ab7000
> [ 36.882172] kexec_file: segment[3]: buf=0x000000006af76441 bufsz=0x16f40a8 mem=0x23bd0b000 memsz=0x16f5000
> [ 36.889113] kexec_file: kexec_file_load: type:0, start:0x23fffb150 head:0x101a2e002 flags:0x8
>
> Changes in v3:
> ==========
> - Rename kexec_core_dbg_print to kexec_dbg_print
> - Remove unnecessary segments prints
> - Remove patch "kexec_file: Fix the issue of mismatch between loop variable types"
>
> Qiang Ma (3):
> kexec: Fix uninitialized struct kimage *image pointer
> kexec: add kexec flag to control debug printing
> kexec: print out debugging message if required for kexec_load
>
> include/linux/kexec.h | 9 +++++----
> include/uapi/linux/kexec.h | 1 +
> kernel/kexec.c | 8 +++++++-
> kernel/kexec_core.c | 4 +++-
> kernel/kexec_file.c | 4 +---
> 5 files changed, 17 insertions(+), 9 deletions(-)
>
> --
> 2.20.1
>
在 2025/11/27 09:47, Baoquan He 写道:
> Hi,
>
> On 11/26/25 at 04:44pm, Qiang Ma wrote:
>> Overview:
>> =========
>> 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().
>>
>> Since kexec_load and kexec_file_load are not triggered simultaneously,
>> we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
> As I said in your last post, this is not needed at all, you just add a
> not needed thing to kernel.
>
> So NACK this patchset, unless you have reason to justify it. Sorry about
> it.
The segment prints discussed in the last post,
this patchset has been removed, leaving only type/start/head of kimage
and flags.
I think the current patchset is still necessary.
For example, renaming kexec_file_dbg_print is still necessary, but not
for kexec_file.
> Thanks
> Baoquan
>
>>
>> Next, we need to do some things in this patchset:
>>
>> 1. rename kexec_file_dbg_print to kexec_dbg_print
>> 2. Add KEXEC_DEBUG
>> 3. Initialize kexec_dbg_print for kexec
>> 4. Fix uninitialized struct kimage *image pointer
>> 5. Set the reset of kexec_dbg_print to kimage_free
>>
>> Testing:
>> =========
>> I did testing on x86_64, arm64 and loongarch. On x86_64, the printed messages
>> look like below:
>>
>> unset CONFIG_KEXEC_FILE:
>> [ 81.502374] kexec: kexec_load: type:0, start:0x23fff7700 head:0x10a4b9002 flags:0x3e0010
>>
>> set CONFIG_KEXEC_FILE
>> [ 36.774228] kexec_file: kernel: 0000000066c386c8 kernel_size: 0xd78400
>> [ 36.821814] kexec-bzImage64: Loaded purgatory at 0x23fffb000
>> [ 36.821826] kexec-bzImage64: Loaded boot_param, command line and misc at 0x23fff9000 bufsz=0x12d0 memsz=0x2000
>> [ 36.821829] kexec-bzImage64: Loaded 64bit kernel at 0x23d400000 bufsz=0xd73400 memsz=0x2ab7000
>> [ 36.821918] kexec-bzImage64: Loaded initrd at 0x23bd0b000 bufsz=0x16f40a8 memsz=0x16f40a8
>> [ 36.821920] kexec-bzImage64: Final command line is: root=/dev/mapper/test-root crashkernel=auto rd.lvm.lv=test/root
>> [ 36.821925] kexec-bzImage64: E820 memmap:
>> [ 36.821926] kexec-bzImage64: 0000000000000000-000000000009ffff (1)
>> [ 36.821928] kexec-bzImage64: 0000000000100000-0000000000811fff (1)
>> [ 36.821930] kexec-bzImage64: 0000000000812000-0000000000812fff (2)
>> [ 36.821931] kexec-bzImage64: 0000000000813000-00000000bee38fff (1)
>> [ 36.821933] kexec-bzImage64: 00000000bee39000-00000000beec2fff (2)
>> [ 36.821934] kexec-bzImage64: 00000000beec3000-00000000bf8ecfff (1)
>> [ 36.821935] kexec-bzImage64: 00000000bf8ed000-00000000bfb6cfff (2)
>> [ 36.821936] kexec-bzImage64: 00000000bfb6d000-00000000bfb7efff (3)
>> [ 36.821937] kexec-bzImage64: 00000000bfb7f000-00000000bfbfefff (4)
>> [ 36.821938] kexec-bzImage64: 00000000bfbff000-00000000bff7bfff (1)
>> [ 36.821939] kexec-bzImage64: 00000000bff7c000-00000000bfffffff (2)
>> [ 36.821940] kexec-bzImage64: 00000000feffc000-00000000feffffff (2)
>> [ 36.821941] kexec-bzImage64: 00000000ffc00000-00000000ffffffff (2)
>> [ 36.821942] kexec-bzImage64: 0000000100000000-000000023fffffff (1)
>> [ 36.872348] kexec_file: nr_segments = 4
>> [ 36.872356] kexec_file: segment[0]: buf=0x000000005314ece7 bufsz=0x4000 mem=0x23fffb000 memsz=0x5000
>> [ 36.872370] kexec_file: segment[1]: buf=0x000000006e59b143 bufsz=0x12d0 mem=0x23fff9000 memsz=0x2000
>> [ 36.872374] kexec_file: segment[2]: buf=0x00000000eb7b1fc3 bufsz=0xd73400 mem=0x23d400000 memsz=0x2ab7000
>> [ 36.882172] kexec_file: segment[3]: buf=0x000000006af76441 bufsz=0x16f40a8 mem=0x23bd0b000 memsz=0x16f5000
>> [ 36.889113] kexec_file: kexec_file_load: type:0, start:0x23fffb150 head:0x101a2e002 flags:0x8
>>
>> Changes in v3:
>> ==========
>> - Rename kexec_core_dbg_print to kexec_dbg_print
>> - Remove unnecessary segments prints
>> - Remove patch "kexec_file: Fix the issue of mismatch between loop variable types"
>>
>> Qiang Ma (3):
>> kexec: Fix uninitialized struct kimage *image pointer
>> kexec: add kexec flag to control debug printing
>> kexec: print out debugging message if required for kexec_load
>>
>> include/linux/kexec.h | 9 +++++----
>> include/uapi/linux/kexec.h | 1 +
>> kernel/kexec.c | 8 +++++++-
>> kernel/kexec_core.c | 4 +++-
>> kernel/kexec_file.c | 4 +---
>> 5 files changed, 17 insertions(+), 9 deletions(-)
>>
>> --
>> 2.20.1
>>
>
On 11/27/25 at 10:04am, Qiang Ma wrote:
>
> 在 2025/11/27 09:47, Baoquan He 写道:
> > Hi,
> >
> > On 11/26/25 at 04:44pm, Qiang Ma wrote:
> > > Overview:
> > > =========
> > > 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().
> > > Since kexec_load and kexec_file_load are not triggered simultaneously,
> > > we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
> > As I said in your last post, this is not needed at all, you just add a
> > not needed thing to kernel.
> >
> > So NACK this patchset, unless you have reason to justify it. Sorry about
> > it.
> The segment prints discussed in the last post,
>
> this patchset has been removed, leaving only type/start/head of kimage and
> flags.
>
>
> I think the current patchset is still necessary.
> For example, renaming kexec_file_dbg_print is still necessary, but not for
> kexec_file.
How come renaming kexec_file_dbg_print is a justification in this case.
No, kexec_file_dbg_print is named because it's only for kexec_file
debugging printing. Because we have had enough debugging printing for
kexec_load interface. Do you have difficulty on debugging printing of
kexec_load?
在 2025/11/27 10:36, Baoquan He 写道:
> On 11/27/25 at 10:04am, Qiang Ma wrote:
>> 在 2025/11/27 09:47, Baoquan He 写道:
>>> Hi,
>>>
>>> On 11/26/25 at 04:44pm, Qiang Ma wrote:
>>>> Overview:
>>>> =========
>>>> 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().
>>>> Since kexec_load and kexec_file_load are not triggered simultaneously,
>>>> we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
>>> As I said in your last post, this is not needed at all, you just add a
>>> not needed thing to kernel.
>>>
>>> So NACK this patchset, unless you have reason to justify it. Sorry about
>>> it.
>> The segment prints discussed in the last post,
>>
>> this patchset has been removed, leaving only type/start/head of kimage and
>> flags.
>>
>>
>> I think the current patchset is still necessary.
>> For example, renaming kexec_file_dbg_print is still necessary, but not for
>> kexec_file.
> How come renaming kexec_file_dbg_print is a justification in this case.
>
> No, kexec_file_dbg_print is named because it's only for kexec_file
> debugging printing. Because we have had enough debugging printing for
> kexec_load interface. Do you have difficulty on debugging printing of
> kexec_load?
It's sufficient now, but there might be a need in the future.
Also, there's kexec_dprintk. Judging from its name, it seems like a
universal kexec print.
Looking at the code, it feels like not only the kexec_file interface
path uses it for printing.
So, would it be better to rename kexec_file_dbg_print to kexec_dbg_print.
>
>
On 11/27/25 at 11:00am, Qiang Ma wrote:
>
> 在 2025/11/27 10:36, Baoquan He 写道:
> > On 11/27/25 at 10:04am, Qiang Ma wrote:
> > > 在 2025/11/27 09:47, Baoquan He 写道:
> > > > Hi,
> > > >
> > > > On 11/26/25 at 04:44pm, Qiang Ma wrote:
> > > > > Overview:
> > > > > =========
> > > > > 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().
> > > > > Since kexec_load and kexec_file_load are not triggered simultaneously,
> > > > > we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
> > > > As I said in your last post, this is not needed at all, you just add a
> > > > not needed thing to kernel.
> > > >
> > > > So NACK this patchset, unless you have reason to justify it. Sorry about
> > > > it.
> > > The segment prints discussed in the last post,
> > >
> > > this patchset has been removed, leaving only type/start/head of kimage and
> > > flags.
> > >
> > >
> > > I think the current patchset is still necessary.
> > > For example, renaming kexec_file_dbg_print is still necessary, but not for
> > > kexec_file.
> > How come renaming kexec_file_dbg_print is a justification in this case.
> >
> > No, kexec_file_dbg_print is named because it's only for kexec_file
> > debugging printing. Because we have had enough debugging printing for
> > kexec_load interface. Do you have difficulty on debugging printing of
> > kexec_load?
> It's sufficient now, but there might be a need in the future.
> Also, there's kexec_dprintk. Judging from its name, it seems like a
Hmm, as I ever said in earlier discussion, kexec sometime means generic
handling including kexec_load and kexec_file_load interfaces. Both possible
future need and kexec_dprintk which seems a little ambiguous to you are
not justified. We do not suggest adding these meaningless code to
kernel. Please do't continue spending effort on this, that is not good.
I welcome cleanup/refactoring/fix for kexec/kdump to improve code, but
adding non-reasonable code is not included.
> universal kexec print.
> Looking at the code, it feels like not only the kexec_file interface path
> uses it for printing.
>
> So, would it be better to rename kexec_file_dbg_print to kexec_dbg_print.
>
>
> >
> >
>
在 2025/11/27 11:55, Baoquan He 写道:
> On 11/27/25 at 11:00am, Qiang Ma wrote:
>> 在 2025/11/27 10:36, Baoquan He 写道:
>>> On 11/27/25 at 10:04am, Qiang Ma wrote:
>>>> 在 2025/11/27 09:47, Baoquan He 写道:
>>>>> Hi,
>>>>>
>>>>> On 11/26/25 at 04:44pm, Qiang Ma wrote:
>>>>>> Overview:
>>>>>> =========
>>>>>> 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().
>>>>>> Since kexec_load and kexec_file_load are not triggered simultaneously,
>>>>>> we can unify the debug flag of kexec and kexec_file as kexec_dbg_print.
>>>>> As I said in your last post, this is not needed at all, you just add a
>>>>> not needed thing to kernel.
>>>>>
>>>>> So NACK this patchset, unless you have reason to justify it. Sorry about
>>>>> it.
>>>> The segment prints discussed in the last post,
>>>>
>>>> this patchset has been removed, leaving only type/start/head of kimage and
>>>> flags.
>>>>
>>>>
>>>> I think the current patchset is still necessary.
>>>> For example, renaming kexec_file_dbg_print is still necessary, but not for
>>>> kexec_file.
>>> How come renaming kexec_file_dbg_print is a justification in this case.
>>>
>>> No, kexec_file_dbg_print is named because it's only for kexec_file
>>> debugging printing. Because we have had enough debugging printing for
>>> kexec_load interface. Do you have difficulty on debugging printing of
>>> kexec_load?
>> It's sufficient now, but there might be a need in the future.
>> Also, there's kexec_dprintk. Judging from its name, it seems like a
> Hmm, as I ever said in earlier discussion, kexec sometime means generic
> handling including kexec_load and kexec_file_load interfaces. Both possible
> future need and kexec_dprintk which seems a little ambiguous to you are
> not justified. We do not suggest adding these meaningless code to
> kernel. Please do't continue spending effort on this, that is not good.
>
> I welcome cleanup/refactoring/fix for kexec/kdump to improve code, but
> adding non-reasonable code is not included.
I agree that meaningless code should not be added to the kernel,
but it is meaningful for this patchset and has reasonable reasons.
Let me summarize again the purpose of submitting this patchset:
First, unify the print flag of kexec_file and kexec as kexec_dbg_print,
so that both kexec and kexec_file can be used both now and in the future.
Secondly, in the current code, for instance, I saw in the arm64 code
that under the kexec_load interface, the kexec_image_info() already uses
kexec_dprintk.
When unset CONFIG_KEXEC_FILE, specifying '-d' for kexec_load interface,
print nothing in the kernel space.
static void _kexec_image_info(const char *func, int line,
const struct kimage *kimage)
{
kexec_dprintk("%s:%d:\n", func, line);
kexec_dprintk(" kexec kimage info:\n");
kexec_dprintk(" type: %d\n", kimage->type);
kexec_dprintk(" head: %lx\n", kimage->head);
Thirdly, for instance, in the arm64 code, the kexec_image_info() prints
type/head of kimage,
while in the RISC-V code, the type/head of kimage under kexec_load and
kexec_file_load is removed.
We can remove the print(type/head of kimage) in arm64, and then add it
to the general code.
For points 1 and 2, Patch 2 can implement: "kexec: add kexec flag to
control debug printing"
For point 3, Patch 3 can be implemented: "kexec: print out debugging
message if required for kexec_load"
Additionally, if it is necessary to remove the type/head of kimage
printed in the kexec_image_info()
in the arm64 code, another patch can be provided.
>> universal kexec print.
>> Looking at the code, it feels like not only the kexec_file interface path
>> uses it for printing.
>>
>> So, would it be better to rename kexec_file_dbg_print to kexec_dbg_print.
>>
>>
>>>
>
© 2016 - 2025 Red Hat, Inc.