* [PATCH] kexec: add kexec flag to support debug printing
@ 2025-11-04 2:59 Qiang Ma
2025-11-11 13:49 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Qiang Ma @ 2025-11-04 2:59 UTC (permalink / raw)
To: kexec; +Cc: horms, bhe, Qiang Ma
This add KEXEC_DEBUG to kexec_flags so that it can be passed
to kernel when '-d' is added with kexec_load interface. With that
flag enabled, kernel can enable the debugging message printing.
This patch requires support from the kexec_load debugging message
of the Linux kernel[1].
[1]: https://lore.kernel.org/kexec/20251103063440.1681657-1-maqianga@uniontech.com/
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
---
kexec/kexec-syscall.h | 1 +
kexec/kexec.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index e9bb7de..b60804f 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -120,6 +120,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
#define KEXEC_PRESERVE_CONTEXT 0x00000002
#define KEXEC_UPDATE_ELFCOREHDR 0x00000004
#define KEXEC_CRASH_HOTPLUG_SUPPORT 0x00000008
+#define KEXEC_DEBUG 0x00000010
#define KEXEC_ARCH_MASK 0xffff0000
/* Flags for kexec file based system call */
diff --git a/kexec/kexec.c b/kexec/kexec.c
index c9e4bcb..f425422 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1518,6 +1518,7 @@ int main(int argc, char *argv[])
return 0;
case OPT_DEBUG:
kexec_debug = 1;
+ kexec_flags |= KEXEC_DEBUG;
kexec_file_flags |= KEXEC_FILE_DEBUG;
break;
case OPT_NOIFDOWN:
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-11 13:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-04 2:59 [PATCH] kexec: add kexec flag to support debug printing Qiang Ma
2025-11-11 13:49 ` Simon Horman
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.