* [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags
@ 2026-06-12 22:39 Brian Mak
2026-06-12 22:39 ` [PATCH 1/3] kexec: Add support for disabling usage of CMA Brian Mak
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Brian Mak @ 2026-06-12 22:39 UTC (permalink / raw)
To: kexec; +Cc: Baoquan He, Alexander Graf, Brian Mak
Hi all,
I realized I forgot to raise a patch series for adding the new kexec_file flags.
Apologies for the delay on this.
This series adds support for the KEXEC_FILE_NO_CMA and KEXEC_FILE_FORCE_DTB
flags, which are used by the --no-cma and --force-dtb options respectively.
I also saw that there's no debug print for the flags passed to kexec_file_load,
so I added a print for that as well, which was useful for me to verify these
patches.
Please let me know if there's any questions or comments.
Thanks,
Brian
Brian Mak (3):
kexec: Add support for disabling usage of CMA
kexec: Add DTB carryover support on x86
kexec: Add kexec_file_load debug print
kexec/kexec-syscall.h | 2 ++
kexec/kexec.c | 10 ++++++++++
kexec/kexec.h | 10 +++++++---
3 files changed, 19 insertions(+), 3 deletions(-)
base-commit: f75be9241accb7a75e98998040933b9f3b988ac5
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] kexec: Add support for disabling usage of CMA
2026-06-12 22:39 [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Brian Mak
@ 2026-06-12 22:39 ` Brian Mak
2026-06-12 22:39 ` [PATCH 2/3] kexec: Add DTB carryover support on x86 Brian Mak
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Brian Mak @ 2026-06-12 22:39 UTC (permalink / raw)
To: kexec; +Cc: Baoquan He, Alexander Graf, Brian Mak
Add support for disabling the use of CMA for placing kexec payloads.
This is done via the --no-cma flag.
Signed-off-by: Brian Mak <makb@juniper.net>
---
kexec/kexec-syscall.h | 1 +
kexec/kexec.c | 4 ++++
kexec/kexec.h | 8 +++++---
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index b60804f..77e6b81 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -128,6 +128,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
#define KEXEC_FILE_ON_CRASH 0x00000002
#define KEXEC_FILE_NO_INITRAMFS 0x00000004
#define KEXEC_FILE_DEBUG 0x00000008
+#define KEXEC_FILE_NO_CMA 0x00000010
/* These values match the ELF architecture values.
* Unless there is a good reason that should continue to be the case.
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 4a49ad4..ccdf4cd 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1102,6 +1102,7 @@ void usage(void)
" --hotplug Do in-kernel update of kexec segments on CPU/Memory\n"
" hot add/remove events, avoiding the need to reload\n"
" kdump kernel on online/offline events.\n"
+ " --no-cma Don't use CMA for placing kexec payloads.\n"
" -d, --debug Enable debugging to help spot a failure.\n"
" -S, --status Return 1 if the type (by default crash) is loaded,\n"
" 0 if not.\n"
@@ -1675,6 +1676,9 @@ int main(int argc, char *argv[])
case OPT_HOTPLUG:
do_hotplug = 1;
break;
+ case OPT_NO_CMA:
+ kexec_file_flags |= KEXEC_FILE_NO_CMA;
+ break;
default:
break;
}
diff --git a/kexec/kexec.h b/kexec/kexec.h
index d0bccb5..a1edc1e 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -234,8 +234,9 @@ extern int file_types;
#define OPT_PRINT_CKR_SIZE 262
#define OPT_LOAD_LIVE_UPDATE 263
#define OPT_EXEC_LIVE_UPDATE 264
-#define OPT_HOTPLUG 265
-#define OPT_MAX 266
+#define OPT_HOTPLUG 265
+#define OPT_NO_CMA 266
+#define OPT_MAX 267
#define KEXEC_OPTIONS \
{ "help", 0, 0, OPT_HELP }, \
{ "version", 0, 0, OPT_VERSION }, \
@@ -262,7 +263,8 @@ extern int file_types;
{ "debug", 0, 0, OPT_DEBUG }, \
{ "status", 0, 0, OPT_STATUS }, \
{ "print-ckr-size", 0, 0, OPT_PRINT_CKR_SIZE }, \
- { "hotplug", 0, 0, OPT_HOTPLUG }, \
+ { "hotplug", 0, 0, OPT_HOTPLUG }, \
+ { "no-cma", 0, 0, OPT_NO_CMA }, \
#define KEXEC_OPT_STR "h?vdfixyluet:pscaS"
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] kexec: Add DTB carryover support on x86
2026-06-12 22:39 [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Brian Mak
2026-06-12 22:39 ` [PATCH 1/3] kexec: Add support for disabling usage of CMA Brian Mak
@ 2026-06-12 22:39 ` Brian Mak
2026-06-12 22:39 ` [PATCH 3/3] kexec: Add kexec_file_load debug print Brian Mak
2026-07-20 9:40 ` [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Simon Horman
3 siblings, 0 replies; 5+ messages in thread
From: Brian Mak @ 2026-06-12 22:39 UTC (permalink / raw)
To: kexec; +Cc: Baoquan He, Alexander Graf, Brian Mak
Add support for forcing the carryover of the current boot's device tree
blob on x86. This is enabled via the --force-dtb flag.
Signed-off-by: Brian Mak <makb@juniper.net>
---
kexec/kexec-syscall.h | 1 +
kexec/kexec.c | 5 +++++
kexec/kexec.h | 4 +++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index 77e6b81..d66bd82 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -129,6 +129,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
#define KEXEC_FILE_NO_INITRAMFS 0x00000004
#define KEXEC_FILE_DEBUG 0x00000008
#define KEXEC_FILE_NO_CMA 0x00000010
+#define KEXEC_FILE_FORCE_DTB 0x00000020
/* These values match the ELF architecture values.
* Unless there is a good reason that should continue to be the case.
diff --git a/kexec/kexec.c b/kexec/kexec.c
index ccdf4cd..acf9699 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1103,6 +1103,8 @@ void usage(void)
" hot add/remove events, avoiding the need to reload\n"
" kdump kernel on online/offline events.\n"
" --no-cma Don't use CMA for placing kexec payloads.\n"
+ " --force-dtb Carry over the current boot's device tree blob (x86\n"
+ " only, this is forced on ARM64 and PPC).\n"
" -d, --debug Enable debugging to help spot a failure.\n"
" -S, --status Return 1 if the type (by default crash) is loaded,\n"
" 0 if not.\n"
@@ -1679,6 +1681,9 @@ int main(int argc, char *argv[])
case OPT_NO_CMA:
kexec_file_flags |= KEXEC_FILE_NO_CMA;
break;
+ case OPT_FORCE_DTB:
+ kexec_file_flags |= KEXEC_FILE_FORCE_DTB;
+ break;
default:
break;
}
diff --git a/kexec/kexec.h b/kexec/kexec.h
index a1edc1e..1489ec3 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -236,7 +236,8 @@ extern int file_types;
#define OPT_EXEC_LIVE_UPDATE 264
#define OPT_HOTPLUG 265
#define OPT_NO_CMA 266
-#define OPT_MAX 267
+#define OPT_FORCE_DTB 267
+#define OPT_MAX 268
#define KEXEC_OPTIONS \
{ "help", 0, 0, OPT_HELP }, \
{ "version", 0, 0, OPT_VERSION }, \
@@ -265,6 +266,7 @@ extern int file_types;
{ "print-ckr-size", 0, 0, OPT_PRINT_CKR_SIZE }, \
{ "hotplug", 0, 0, OPT_HOTPLUG }, \
{ "no-cma", 0, 0, OPT_NO_CMA }, \
+ { "force-dtb", 0, 0, OPT_FORCE_DTB }, \
#define KEXEC_OPT_STR "h?vdfixyluet:pscaS"
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] kexec: Add kexec_file_load debug print
2026-06-12 22:39 [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Brian Mak
2026-06-12 22:39 ` [PATCH 1/3] kexec: Add support for disabling usage of CMA Brian Mak
2026-06-12 22:39 ` [PATCH 2/3] kexec: Add DTB carryover support on x86 Brian Mak
@ 2026-06-12 22:39 ` Brian Mak
2026-07-20 9:40 ` [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Simon Horman
3 siblings, 0 replies; 5+ messages in thread
From: Brian Mak @ 2026-06-12 22:39 UTC (permalink / raw)
To: kexec; +Cc: Baoquan He, Alexander Graf, Brian Mak
Add a debug print before kexec_file_load to print the flags passed to
the syscall.
Signed-off-by: Brian Mak <makb@juniper.net>
---
kexec/kexec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index acf9699..58cab57 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1422,6 +1422,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
if (info.initrd_fd == -1)
info.kexec_flags |= KEXEC_FILE_NO_INITRAMFS;
+ dbgprintf("kexec_file_load: flags = 0x%lx\n", info.kexec_flags);
ret = kexec_file_load(kernel_fd, info.initrd_fd, info.command_line_len,
info.command_line, info.kexec_flags);
if (ret != 0) {
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags
2026-06-12 22:39 [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Brian Mak
` (2 preceding siblings ...)
2026-06-12 22:39 ` [PATCH 3/3] kexec: Add kexec_file_load debug print Brian Mak
@ 2026-07-20 9:40 ` Simon Horman
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2026-07-20 9:40 UTC (permalink / raw)
To: Brian Mak; +Cc: kexec, Baoquan He, Alexander Graf
On Fri, Jun 12, 2026 at 03:39:42PM -0700, Brian Mak wrote:
> Hi all,
>
> I realized I forgot to raise a patch series for adding the new kexec_file flags.
> Apologies for the delay on this.
>
> This series adds support for the KEXEC_FILE_NO_CMA and KEXEC_FILE_FORCE_DTB
> flags, which are used by the --no-cma and --force-dtb options respectively.
>
> I also saw that there's no debug print for the flags passed to kexec_file_load,
> so I added a print for that as well, which was useful for me to verify these
> patches.
>
> Please let me know if there's any questions or comments.
Thanks, and likewise sorry for the delay.
Applied as:
- kexec: Add kexec_file_load debug print
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=29898e149feb
- kexec: Add DTB carryover support on x86
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=d5a495bfbfc9
- kexec: Add support for disabling usage of CMA
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=e4de788721cb
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-20 9:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 22:39 [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Brian Mak
2026-06-12 22:39 ` [PATCH 1/3] kexec: Add support for disabling usage of CMA Brian Mak
2026-06-12 22:39 ` [PATCH 2/3] kexec: Add DTB carryover support on x86 Brian Mak
2026-06-12 22:39 ` [PATCH 3/3] kexec: Add kexec_file_load debug print Brian Mak
2026-07-20 9:40 ` [PATCH 0/3] kexec-tools: Add new KEXEC_FILE flags Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox