arm64: enable KEXEC_FILE config
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Thu, 15 Nov 2018 05:52:48 +0000 (14:52 +0900)
committerWill Deacon <will.deacon@arm.com>
Thu, 6 Dec 2018 14:38:52 +0000 (14:38 +0000)
Modify arm64/Kconfig to enable kexec_file_load support.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Kconfig
arch/arm64/kernel/Makefile
arch/arm64/kernel/machine_kexec_file.c [new file with mode: 0644]

index 787d7850e0643d80197e29bcfbfedf6d40ab46eb..93dc4d36d6dbd4d885be52a5eff013c25d9921e0 100644 (file)
@@ -858,6 +858,15 @@ config KEXEC
          but it is independent of the system firmware.   And like a reboot
          you can start any kernel with it, not just Linux.
 
+config KEXEC_FILE
+       bool "kexec file based system call"
+       select KEXEC_CORE
+       help
+         This is new version of kexec system call. This system call is
+         file based and takes file descriptors as system call argument
+         for kernel and initramfs as opposed to list of segments as
+         accepted by previous system call.
+
 config CRASH_DUMP
        bool "Build kdump crash kernel"
        help
index 4c8b13bede80f98195ba1090fea11601a6d3df22..030a39bff11774c6fcc9ac44da5975dc1d91e4ae 100644 (file)
@@ -49,8 +49,9 @@ arm64-obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL)       += acpi_parking_protocol.o
 arm64-obj-$(CONFIG_PARAVIRT)           += paravirt.o
 arm64-obj-$(CONFIG_RANDOMIZE_BASE)     += kaslr.o
 arm64-obj-$(CONFIG_HIBERNATION)                += hibernate.o hibernate-asm.o
-arm64-obj-$(CONFIG_KEXEC)              += machine_kexec.o relocate_kernel.o    \
+arm64-obj-$(CONFIG_KEXEC_CORE)         += machine_kexec.o relocate_kernel.o    \
                                           cpu-reset.o
+arm64-obj-$(CONFIG_KEXEC_FILE)         += machine_kexec_file.o
 arm64-obj-$(CONFIG_ARM64_RELOC_TEST)   += arm64-reloc-test.o
 arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o
 arm64-obj-$(CONFIG_CRASH_DUMP)         += crash_dump.o
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
new file mode 100644 (file)
index 0000000..c38a804
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * kexec_file for arm64
+ *
+ * Copyright (C) 2018 Linaro Limited
+ * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
+ *
+ */
+
+#define pr_fmt(fmt) "kexec_file: " fmt
+
+#include <linux/kexec.h>
+
+const struct kexec_file_ops * const kexec_file_loaders[] = {
+       NULL
+};