History

x86/kexec: carry forward the boot DTB on kexec

Currently, the kexec_file_load syscall on x86 does not support passing a device tree blob to the new kernel. Some embedded x86 systems use device trees. On these systems, failing to pass a device tree to the new kernel causes a boot failure. To add support for this, we copy the behavior of ARM64 and PowerPC and copy the current boot's device tree blob for use in the new kernel. We do this on x86 by passing the device tree blob as a setup_data entry in accordance with the x86 boot protocol. This behavior is gated behind the KEXEC_FILE_FORCE_DTB flag.

Brian Mak committed 1 year ago

Commit f3674741 parent 14406484 files · +53 −4Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/kexec.h+4−0
@@ -22,12 +22,16 @@ · 21 unmodified lines
2222 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
2323 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
2424 * fd field.
25+ * KEXEC_FILE_FORCE_DTB : Force carrying over the current boot's DTB to the new
26+ * kernel on x86. This is already the default behavior on
27+ * some other architectures, like ARM64 and PowerPC.
2528 */
2629 #define KEXEC_FILE_UNLOAD 0x00000001
2730 #define KEXEC_FILE_ON_CRASH 0x00000002
2831 #define KEXEC_FILE_NO_INITRAMFS 0x00000004
2932 #define KEXEC_FILE_DEBUG 0x00000008
3033 #define KEXEC_FILE_NO_CMA 0x00000010
34+#define KEXEC_FILE_FORCE_DTB 0x00000020
3135
3236 /* These values match the ELF architecture values.
3337 * Unless there is a good reason that should continue to be the case.