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
22 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.22 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
23 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd23 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
24 * fd field.24 * 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.
25 */28 */
26#define KEXEC_FILE_UNLOAD 0x0000000129#define KEXEC_FILE_UNLOAD 0x00000001
27#define KEXEC_FILE_ON_CRASH 0x0000000230#define KEXEC_FILE_ON_CRASH 0x00000002
28#define KEXEC_FILE_NO_INITRAMFS 0x0000000431#define KEXEC_FILE_NO_INITRAMFS 0x00000004
29#define KEXEC_FILE_DEBUG 0x0000000832#define KEXEC_FILE_DEBUG 0x00000008
30#define KEXEC_FILE_NO_CMA 0x0000001033#define KEXEC_FILE_NO_CMA 0x00000010
34#define KEXEC_FILE_FORCE_DTB 0x00000020
31 35
32/* These values match the ELF architecture values.36/* These values match the ELF architecture values.
33 * Unless there is a good reason that should continue to be the case.37 * Unless there is a good reason that should continue to be the case.