diff mbox series

[8/9] arm64: enable KEXEC_FILE config

Message ID 20170908031616.17916-9-takahiro.akashi@linaro.org
State New
Headers show
Series kexec: add kexec_file_load() support | expand

Commit Message

AKASHI Takahiro Sept. 8, 2017, 3:16 a.m. UTC
Modify arm64/Kconfig and Makefile 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>
---
 arch/arm64/Kconfig         | 22 ++++++++++++++++++++++
 arch/arm64/kernel/Makefile |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)

-- 
2.14.1

Comments

kernel test robot Sept. 10, 2017, 3:41 p.m. UTC | #1
Hi AKASHI,

[auto build test ERROR on arm64/for-next/core]
[also build test ERROR on v4.13 next-20170908]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/AKASHI-Takahiro/kexec-add-kexec_file_load-support/20170910-143930
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm64 

Note: the linux-review/AKASHI-Takahiro/kexec-add-kexec_file_load-support/20170910-143930 HEAD caf976acefa5a78ad88489581c66b98cbc8f91fa builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

>> arch/arm64/kernel/machine_kexec_file.c:22:28: fatal error: asm/kexec_file.h: No such file or directory

    #include <asm/kexec_file.h>
                               ^
   compilation terminated.

vim +22 arch/arm64/kernel/machine_kexec_file.c

423cf6dc9f AKASHI Takahiro 2017-09-08  15  
423cf6dc9f AKASHI Takahiro 2017-09-08  16  #include <linux/errno.h>
423cf6dc9f AKASHI Takahiro 2017-09-08  17  #include <linux/kernel.h>
423cf6dc9f AKASHI Takahiro 2017-09-08  18  #include <linux/kexec.h>
423cf6dc9f AKASHI Takahiro 2017-09-08  19  #include <linux/libfdt.h>
423cf6dc9f AKASHI Takahiro 2017-09-08  20  #include <linux/memblock.h>
423cf6dc9f AKASHI Takahiro 2017-09-08  21  #include <linux/of_fdt.h>
423cf6dc9f AKASHI Takahiro 2017-09-08 @22  #include <asm/kexec_file.h>
423cf6dc9f AKASHI Takahiro 2017-09-08  23  

:::::: The code at line 22 was first introduced by commit
:::::: 423cf6dc9f06d95907902b2b7f84161bdc98f752 arm64: kexec_file: load initrd, device-tree and purgatory segments

:::::: TO: AKASHI Takahiro <takahiro.akashi@linaro.org>
:::::: CC: 0day robot <fengguang.wu@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
AKASHI Takahiro Sept. 12, 2017, 4:43 a.m. UTC | #2
On Sun, Sep 10, 2017 at 11:41:47PM +0800, kbuild test robot wrote:
> Hi AKASHI,

> 

> [auto build test ERROR on arm64/for-next/core]

> [also build test ERROR on v4.13 next-20170908]

> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

> 

> url:    https://github.com/0day-ci/linux/commits/AKASHI-Takahiro/kexec-add-kexec_file_load-support/20170910-143930

> base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core

> config: arm64-allmodconfig (attached as .config)

> compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705

> reproduce:

>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross

>         chmod +x ~/bin/make.cross

>         # save the attached .config to linux build tree

>         make.cross ARCH=arm64 

> 

> Note: the linux-review/AKASHI-Takahiro/kexec-add-kexec_file_load-support/20170910-143930 HEAD caf976acefa5a78ad88489581c66b98cbc8f91fa builds fine.

>       It only hurts bisectibility.

> 

> All errors (new ones prefixed by >>):

> 

> >> arch/arm64/kernel/machine_kexec_file.c:22:28: fatal error: asm/kexec_file.h: No such file or directory

>     #include <asm/kexec_file.h>

>                                ^


Will fix it in the next version, v3.

-Takahiro AKASHI

>    compilation terminated.

> 

> vim +22 arch/arm64/kernel/machine_kexec_file.c

> 

> 423cf6dc9f AKASHI Takahiro 2017-09-08  15  

> 423cf6dc9f AKASHI Takahiro 2017-09-08  16  #include <linux/errno.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08  17  #include <linux/kernel.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08  18  #include <linux/kexec.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08  19  #include <linux/libfdt.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08  20  #include <linux/memblock.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08  21  #include <linux/of_fdt.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08 @22  #include <asm/kexec_file.h>

> 423cf6dc9f AKASHI Takahiro 2017-09-08  23  

> 

> :::::: The code at line 22 was first introduced by commit

> :::::: 423cf6dc9f06d95907902b2b7f84161bdc98f752 arm64: kexec_file: load initrd, device-tree and purgatory segments

> 

> :::::: TO: AKASHI Takahiro <takahiro.akashi@linaro.org>

> :::::: CC: 0day robot <fengguang.wu@intel.com>

> 

> ---

> 0-DAY kernel test infrastructure                Open Source Technology Center

> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index dfd908630631..fa7299f08cc6 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -756,6 +756,28 @@  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
+	select BUILD_BIN2C
+	---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.
+
+	  In addition to this option, you need to enable a specific type
+	  of image support.
+
+config KEXEC_VERIFY_SIG
+	bool "Verify kernel signature during kexec_file_load() syscall"
+	depends on KEXEC_FILE
+	select SYSTEM_DATA_VERIFICATION
+	---help---
+	  Select this option to verify a signature with loaded kernel
+	  image. If configured, any attempt of loading a image without
+	  valid signature will fail.
+
 config CRASH_DUMP
 	bool "Build kdump crash kernel"
 	help
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 16e9f56b536a..5df003d6157c 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -48,7 +48,7 @@  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