Skip to content

Commit 6310c14

Browse files
makb-juniperakpm00
authored andcommitted
kexec: add KEXEC_FILE_NO_CMA as a legal flag
Commit 07d2490 ("kexec: enable CMA based contiguous allocation") introduces logic to use CMA-based allocation in kexec by default. As part of the changes, it introduces a kexec_file_load flag to disable the use of CMA allocations from userspace. However, this flag is broken since it is missing from the list of legal flags for kexec_file_load. kexec_file_load returns EINVAL when attempting to use the flag. Fix this by adding the KEXEC_FILE_NO_CMA flag to the list of legal flags for kexec_file_load. Without this fix, kexec_file_load syscall will failed and return '-EINVAL' when KEXEC_FILE_NO_CMA is specified. Link: https://lkml.kernel.org/r/[email protected] Fixes: 07d2490 ("kexec: enable CMA based contiguous allocation") Signed-off-by: Brian Mak <[email protected]> Acked-by: Baoquan He <[email protected]> Cc: Alexander Graf <[email protected]> Cc: Borislav Betkov <[email protected]> Cc: Dave Young <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Rob Herring <[email protected]> Cc: Saravana Kannan <[email protected]> Cc: Thomas Gleinxer <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 51337a9 commit 6310c14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/kexec.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ bool kexec_load_permitted(int kexec_image_type);
460460

461461
/* List of defined/legal kexec file flags */
462462
#define KEXEC_FILE_FLAGS (KEXEC_FILE_UNLOAD | KEXEC_FILE_ON_CRASH | \
463-
KEXEC_FILE_NO_INITRAMFS | KEXEC_FILE_DEBUG)
463+
KEXEC_FILE_NO_INITRAMFS | KEXEC_FILE_DEBUG | \
464+
KEXEC_FILE_NO_CMA)
464465

465466
/* flag to track if kexec reboot is in progress */
466467
extern bool kexec_in_progress;

0 commit comments

Comments
 (0)