Skip to contentSkip to conversation

kexec: refactor CONFIG_KEXEC/CONFIG_KEXEC_FILE Kconfig

PATCH In review [email protected] 2 participants 7 messages Jul 20, 2015 – Jul 22, 2015

Subsystems (20)
Arm (32-bit) x86 VFS PowerPC +16 more subsystems
lore
Share & tools
lore
#0 lore raw

v2 cover kexec: refactor CONFIG_KEXEC/CONFIG_KEXEC_FILE Kconfig

Previously Theodore Ts'o brought up an issue about kexec_load syscall bypassing signature verification:
https://lkml.org/lkml/2015/6/14/280

Because we have two kexec load syscall, one kexec_load, another kexec_file_load, the latter one was introduced by Vivek Goyal, it is mainly for supporting UEFI secure boot. kexec_file_load verifies kernel signature, but even if with CONFIG_KEXEC_VERIFY_SIG=y and CONFIG_KEXEC_FILE=y, kexec-tools still can use old syscall and bypass signature verification.

KEXEC_FILE can also be used without UEFI, so kexec can always verify kernel signature for security purpose.

The suggestion in above thread is add a new Kconfig option for kexec common code, here I use KEXEC_CORE, KEXEC and KEXEC_FILE select KEXEC_CORE so one can compile only KEXEC_FILE without old kexec_load syscall.

There's checkpatch warnings and errors, I would like to send furthuer cleanup patches after this series. Please let me know if you have other suggestions. checkpatch errors are for cases such as assign a value to static variables.

Changes to V1:
* drop patch 3/3 which is not belonging to this series
* move KEXEC_CORE to generic arch/Kconfig, arch KEXEC selects KEXEC_CORE
* add KEXEC_CORE in s390 arch.

Tested kexec_load only, kexec_file_load only, kexec and kexec_file_load built in cases in x86. For kexec_file_load, tested signed and un-signed kernel. Tested kexec_load in powerpc64 arch.
Build tested arm arch.

For kexec_file_load, if you do not specify "-s" in kexec-tools, kexec load will hang, though "-s" is mandatory for kexec_file_load, kexec should still fail out instead of hanging there, here is a fix in kexec-tools:

kexec/crashdump-elf.c +5 -4
@@ -145,11 +145,12 @@ int FUNC(struct kexec_info *info,
 
 	count_cpu = nr_cpus;
 	for (i = 0; count_cpu > 0; i++) {
-		if (get_note_info(i, &notes_addr, &notes_len) < 0) {
-			/* This cpu is not present. Skip it. */
-			continue;
-		}
+		int ret;
+
+		ret = get_note_info(i, &notes_addr, &notes_len);
 		count_cpu--;
+		if (ret < 0) /* This cpu is not present. Skip it. */
+			continue;
 
 		phdr = (PHDR *) bufp;
 		bufp += sizeof(PHDR);

Below is the diffstat of the patche series:
--

 arch/Kconfig                  |    3 
 arch/arm/Kconfig              |    1 
 arch/ia64/Kconfig             |    1 
 arch/m68k/Kconfig             |    1 
 arch/mips/Kconfig             |    1 
 arch/powerpc/Kconfig          |    1 
 arch/s390/Kconfig             |    1 
 arch/sh/Kconfig               |    1 
 arch/tile/Kconfig             |    1 
 arch/x86/Kconfig              |    3 
 arch/x86/boot/header.S        |    2 
 arch/x86/include/asm/kdebug.h |    2 
 arch/x86/kernel/Makefile      |    4 
 arch/x86/kernel/kvmclock.c    |    4 
 arch/x86/kernel/reboot.c      |    4 
 arch/x86/kernel/setup.c       |    2 
 arch/x86/kernel/vmlinux.lds.S |    2 
 arch/x86/kvm/vmx.c            |    8 
 arch/x86/platform/efi/efi.c   |    4 
 arch/x86/platform/uv/uv_nmi.c |    6 
 drivers/firmware/efi/Kconfig  |    2 
 drivers/pci/pci-driver.c      |    2 
 include/linux/kexec.h         |   12 
 init/initramfs.c              |    4 
 kernel/Makefile               |    2 
 kernel/events/core.c          |    2 
 kernel/kexec.c                | 2633 ------------------------------------------
 kernel/kexec_core.c           | 1594 +++++++++++++++++++++++++
 kernel/kexec_file.c           | 1044 ++++++++++++++++
 kernel/kexec_internal.h       |   22 
 kernel/ksysfs.c               |    6 
 kernel/printk/printk.c        |    2 
 kernel/reboot.c               |    2 
 kernel/sysctl.c               |    2 
 34 files changed, 2725 insertions(+), 2656 deletions(-)

--
Thanks
Dave

#1 lore raw

PATCH v2 1/2 kexec: split kexec_file syscall code to kexec_file.c

Split kexec_file syscall related code to another file kernel/kexec_file.c so that the #ifdef CONFIG_KEXEC_FILE in kexec.c can be dropped.

Sharing variables and functions are moved to kernel/kexec_internal.h per suggestion from Vivek and Petr.

---
 kernel/Makefile         |    1 
 kernel/kexec.c          | 1055 ------------------------------------------------
 kernel/kexec_file.c     | 1044 +++++++++++++++++++++++++++++++++++++++++++++++
 kernel/kexec_internal.h |   22 +
 4 files changed, 1077 insertions(+), 1045 deletions(-)
 create mode 100644 kernel/kexec_file.c
 create mode 100644 kernel/kexec_internal.h
kernel/Makefile +1 -0
@@ -51,6 +51,7 @@ obj-$(CONFIG_MODULE_SIG) += module_signi
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
 obj-$(CONFIG_KEXEC) += kexec.o
+obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
 obj-$(CONFIG_COMPAT) += compat.o
 obj-$(CONFIG_CGROUPS) += cgroup.o
kernel/kexec.c +10 -1045

1,145 lines not on this page · raw message

kernel/kexec_file.c new file +1044 -0

1,044 lines not on this page · raw message

kernel/kexec_internal.h new file +22 -0
@@ -0,0 +1,22 @@
+#ifndef LINUX_KEXEC_INTERNAL_H
+#define LINUX_KEXEC_INTERNAL_H
+
+#include <linux/kexec.h>
+
+struct kimage *do_kimage_alloc_init(void);
+int sanity_check_segment_list(struct kimage *image);
+void kimage_free_page_list(struct list_head *list);
+void kimage_free(struct kimage *image);
+int kimage_load_segment(struct kimage *image, struct kexec_segment *segment);
+void kimage_terminate(struct kimage *image);
+int kimage_is_destination_range(struct kimage *image,
+				unsigned long start, unsigned long end);
+
+extern struct mutex kexec_mutex;
+
+#ifdef CONFIG_KEXEC_FILE
+void kimage_file_post_load_cleanup(struct kimage *image);
+#else /* CONFIG_KEXEC_FILE */
+static inline void kimage_file_post_load_cleanup(struct kimage *image) { }
+#endif /* CONFIG_KEXEC_FILE */
+#endif /* LINUX_KEXEC_INTERNAL_H */
#2 lore raw

PATCH v2 2/2 kexec: split kexec_load syscall from kexec core code

In reply to [email protected]

Now there's two kexec load syscall, one is kexec_load another is kexec_file_load, kexec_file_load has been splited as kernel/kexec_file.c. In this patch I split kexec_load syscall code to kernel/kexec.c.

And add a new kconfig option KEXEC_CORE, so we can disable kexec_load and use kexec_file_load only, or vice verse.

The original requirement is from Tedso, he want kexec kernel signature being checked with CONFIG_KEXEC_VERIFY_SIG enabled. But kexec-tools use kexec_load syscall can bypass the checking.

Vivek Goyal proposed to create a common kconfig option so user can compile in only one syscall for loading kexec kernel. KEXEC/KEXEC_FILE selects KEXEC_CORE so that old config files still work.

Because there's general code need CONFIG_KEXEC_CORE, so I updated all the architecture Kconfig with a new option KEXEC_CORE, and let KEXEC selects KEXEC_CORE in arch Kconfig. Also updated general kernel code with to kexec_load syscall.

---
 arch/Kconfig                  |    3 
 arch/arm/Kconfig              |    1 
 arch/ia64/Kconfig             |    1 
 arch/m68k/Kconfig             |    1 
 arch/mips/Kconfig             |    1 
 arch/powerpc/Kconfig          |    1 
 arch/s390/Kconfig             |    1 
 arch/sh/Kconfig               |    1 
 arch/tile/Kconfig             |    1 
 arch/x86/Kconfig              |    3 
 arch/x86/boot/header.S        |    2 
 arch/x86/include/asm/kdebug.h |    2 
 arch/x86/kernel/Makefile      |    4 
 arch/x86/kernel/kvmclock.c    |    4 
 arch/x86/kernel/reboot.c      |    4 
 arch/x86/kernel/setup.c       |    2 
 arch/x86/kernel/vmlinux.lds.S |    2 
 arch/x86/kvm/vmx.c            |    8 
 arch/x86/platform/efi/efi.c   |    4 
 arch/x86/platform/uv/uv_nmi.c |    6 
 drivers/firmware/efi/Kconfig  |    2 
 drivers/pci/pci-driver.c      |    2 
 include/linux/kexec.h         |   12 
 init/initramfs.c              |    4 
 kernel/Makefile               |    1 
 kernel/events/core.c          |    2 
 kernel/kexec.c                | 1578 -----------------------------------------
 kernel/kexec_core.c           | 1594 ++++++++++++++++++++++++++++++++++++++++++
 kernel/ksysfs.c               |    6 
 kernel/printk/printk.c        |    2 
 kernel/reboot.c               |    2 
 kernel/sysctl.c               |    2 
 32 files changed, 1648 insertions(+), 1611 deletions(-)
 create mode 100644 kernel/kexec_core.c
arch/Kconfig +3 -0
@@ -2,6 +2,9 @@
 # General architecture dependent options
 #
 
+config KEXEC_CORE
+	bool
+
 config OPROFILE
 	tristate "OProfile system profiling"
 	depends on PROFILING
arch/arm/Kconfig +1 -0
@@ -2005,6 +2005,7 @@ config KEXEC
 	bool "Kexec system call (EXPERIMENTAL)"
 	depends on (!SMP || PM_SLEEP_SMP)
 	depends on !CPU_V7M
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/ia64/Kconfig +1 -0
@@ -518,6 +518,7 @@ source "drivers/sn/Kconfig"
 config KEXEC
 	bool "kexec system call"
 	depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/m68k/Kconfig +1 -0
@@ -95,6 +95,7 @@ config MMU_SUN3
 config KEXEC
 	bool "kexec system call"
 	depends on M68KCLASSIC
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/mips/Kconfig +1 -0
@@ -2592,6 +2592,7 @@ source "kernel/Kconfig.preempt"
 
 config KEXEC
 	bool "Kexec system call"
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/powerpc/Kconfig +1 -0
@@ -415,6 +415,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
 config KEXEC
 	bool "kexec system call"
 	depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP))
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/s390/Kconfig +1 -0
@@ -48,6 +48,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 
 config KEXEC
 	def_bool y
+	select KEXEC_CORE
 
 config AUDIT_ARCH
 	def_bool y
arch/sh/Kconfig +1 -0
@@ -602,6 +602,7 @@ source kernel/Kconfig.hz
 config KEXEC
 	bool "kexec system call (EXPERIMENTAL)"
 	depends on SUPERH32 && MMU
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/tile/Kconfig +1 -0
@@ -204,6 +204,7 @@ source "kernel/Kconfig.hz"
 
 config KEXEC
 	bool "kexec system call"
+	select KEXEC_CORE
 	---help---
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/x86/Kconfig +2 -1
@@ -1724,6 +1724,7 @@ source kernel/Kconfig.hz
 
 config KEXEC
 	bool "kexec system call"
+	select KEXEC_CORE
 	---help---
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
@@ -1740,8 +1741,8 @@ config KEXEC
 
 config KEXEC_FILE
 	bool "kexec file based system call"
+	select KEXEC_CORE
 	select BUILD_BIN2C
-	depends on KEXEC
 	depends on X86_64
 	depends on CRYPTO=y
 	depends on CRYPTO_SHA256=y
arch/x86/boot/header.S +1 -1
@@ -414,7 +414,7 @@ xloadflags:
 # define XLF23 0
 #endif
 
-#if defined(CONFIG_X86_64) && defined(CONFIG_EFI) && defined(CONFIG_KEXEC)
+#if defined(CONFIG_X86_64) && defined(CONFIG_EFI) && defined(CONFIG_KEXEC_CORE)
 # define XLF4 XLF_EFI_KEXEC
 #else
 # define XLF4 0
arch/x86/include/asm/kdebug.h +1 -1
@@ -29,7 +29,7 @@ extern void show_trace(struct task_struc
 extern void __show_regs(struct pt_regs *regs, int all);
 extern unsigned long oops_begin(void);
 extern void oops_end(unsigned long, struct pt_regs *, int signr);
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 extern int in_crash_kexec;
 #else
 /* no crash dump is ever in progress if no crash kernel can be kexec'd */
arch/x86/kernel/Makefile +2 -2
@@ -69,8 +69,8 @@ obj-$(CONFIG_LIVEPATCH)		+= livepatch.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
 obj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
 obj-$(CONFIG_X86_TSC)		+= trace_clock.o
-obj-$(CONFIG_KEXEC)		+= machine_kexec_$(BITS).o
-obj-$(CONFIG_KEXEC)		+= relocate_kernel_$(BITS).o crash.o
+obj-$(CONFIG_KEXEC_CORE)	+= machine_kexec_$(BITS).o
+obj-$(CONFIG_KEXEC_CORE)	+= relocate_kernel_$(BITS).o crash.o
 obj-$(CONFIG_KEXEC_FILE)	+= kexec-bzimage64.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump_$(BITS).o
 obj-y				+= kprobes/
arch/x86/kernel/kvmclock.c +2 -2
@@ -200,7 +200,7 @@ static void kvm_setup_secondary_clock(vo
  * kind of shutdown from our side, we unregister the clock by writting anything
  * that does not have the 'enable' bit set in the msr
  */
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 static void kvm_crash_shutdown(struct pt_regs *regs)
 {
 	native_write_msr(msr_kvm_system_time, 0, 0);
@@ -259,7 +259,7 @@ void __init kvmclock_init(void)
 	x86_platform.save_sched_clock_state = kvm_save_sched_clock_state;
 	x86_platform.restore_sched_clock_state = kvm_restore_sched_clock_state;
 	machine_ops.shutdown  = kvm_shutdown;
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	machine_ops.crash_shutdown  = kvm_crash_shutdown;
 #endif
 	kvm_get_preset_lpj();
arch/x86/kernel/reboot.c +2 -2
@@ -673,7 +673,7 @@ struct machine_ops machine_ops = {
 	.emergency_restart = native_machine_emergency_restart,
 	.restart = native_machine_restart,
 	.halt = native_machine_halt,
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	.crash_shutdown = native_machine_crash_shutdown,
 #endif
 };
@@ -703,7 +703,7 @@ void machine_halt(void)
 	machine_ops.halt();
 }
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 void machine_crash_shutdown(struct pt_regs *regs)
 {
 	machine_ops.crash_shutdown(regs);
arch/x86/kernel/setup.c +1 -1
@@ -498,7 +498,7 @@ static void __init memblock_x86_reserve_
  * --------- Crashkernel reservation ------------------------------
  */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 
 /*
  * Keep the crash kernel below this limit.  On 32 bits earlier kernels
arch/x86/kernel/vmlinux.lds.S +1 -1
@@ -364,7 +364,7 @@ INIT_PER_CPU(irq_stack_union);
 
 #endif /* CONFIG_X86_32 */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <asm/kexec.h>
 
 . = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
arch/x86/kvm/vmx.c +4 -4
@@ -1264,7 +1264,7 @@ static void vmcs_load(struct vmcs *vmcs)
 		       vmcs, phys_addr);
 }
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 /*
  * This bitmap is used to indicate whether the vmclear
  * operation is enabled on all cpus. All disabled by
@@ -1302,7 +1302,7 @@ static void crash_vmclear_local_loaded_v
 #else
 static inline void crash_enable_local_vmclear(int cpu) { }
 static inline void crash_disable_local_vmclear(int cpu) { }
-#endif /* CONFIG_KEXEC */
+#endif /* CONFIG_KEXEC_CORE */
 
 static void __loaded_vmcs_clear(void *arg)
 {
@@ -10425,7 +10425,7 @@ static int __init vmx_init(void)
 	if (r)
 		return r;
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	rcu_assign_pointer(crash_vmclear_loaded_vmcss,
 			   crash_vmclear_local_loaded_vmcss);
 #endif
@@ -10435,7 +10435,7 @@ static int __init vmx_init(void)
 
 static void __exit vmx_exit(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	RCU_INIT_POINTER(crash_vmclear_loaded_vmcss, NULL);
 	synchronize_rcu();
 #endif
arch/x86/platform/efi/efi.c +2 -2
@@ -650,7 +650,7 @@ static void __init get_systab_virt_addr(
 
 static void __init save_runtime_map(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	efi_memory_desc_t *md;
 	void *tmp, *p, *q = NULL;
 	int count = 0;
@@ -748,7 +748,7 @@ static void * __init efi_map_regions(int
 
 static void __init kexec_enter_virtual_mode(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	efi_memory_desc_t *md;
 	void *p;
 
arch/x86/platform/uv/uv_nmi.c +3 -3
@@ -492,7 +492,7 @@ static void uv_nmi_touch_watchdogs(void)
 	touch_nmi_watchdog();
 }
 
-#if defined(CONFIG_KEXEC)
+#if defined(CONFIG_KEXEC_CORE)
 static atomic_t uv_nmi_kexec_failed;
 static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
 {
@@ -519,13 +519,13 @@ static void uv_nmi_kdump(int cpu, int ma
 	uv_nmi_sync_exit(0);
 }
 
-#else /* !CONFIG_KEXEC */
+#else /* !CONFIG_KEXEC_CORE */
 static inline void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
 {
 	if (master)
 		pr_err("UV: NMI kdump: KEXEC not supported in this kernel\n");
 }
-#endif /* !CONFIG_KEXEC */
+#endif /* !CONFIG_KEXEC_CORE */
 
 #ifdef CONFIG_KGDB
 #ifdef CONFIG_KGDB_KDB
drivers/firmware/efi/Kconfig +1 -1
@@ -43,7 +43,7 @@ config EFI_VARS_PSTORE_DEFAULT_DISABLE
 
 config EFI_RUNTIME_MAP
 	bool "Export efi runtime maps to sysfs"
-	depends on X86 && EFI && KEXEC
+	depends on X86 && EFI && KEXEC_CORE
 	default y
 	help
 	  Export efi runtime memory maps to /sys/firmware/efi/runtime-map.
drivers/pci/pci-driver.c +1 -1
@@ -453,7 +453,7 @@ static void pci_device_shutdown(struct d
 	pci_msi_shutdown(pci_dev);
 	pci_msix_shutdown(pci_dev);
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	/*
 	 * If this is a kexec reboot, turn off Bus Master bit on the
 	 * device to tell it to not continue to do DMA. Don't touch
include/linux/kexec.h +9 -3
@@ -16,7 +16,7 @@
 
 #include <uapi/linux/kexec.h>
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/list.h>
 #include <linux/linkage.h>
 #include <linux/compat.h>
@@ -318,12 +318,18 @@ int crash_shrink_memory(unsigned long ne
 size_t crash_get_memory_size(void);
 void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
 
-#else /* !CONFIG_KEXEC */
+#ifdef CONFIG_KEXEC
+int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
+			     unsigned long nr_segments,
+			     struct kexec_segment __user *segments,
+			     unsigned long flags);
+#endif
+#else /* !CONFIG_KEXEC_CORE */
 struct pt_regs;
 struct task_struct;
 static inline void crash_kexec(struct pt_regs *regs) { }
 static inline int kexec_should_crash(struct task_struct *p) { return 0; }
-#endif /* CONFIG_KEXEC */
+#endif /* CONFIG_KEXEC_CORE */
 
 #endif /* !defined(__ASSEBMLY__) */
 
init/initramfs.c +2 -2
@@ -526,14 +526,14 @@ extern unsigned long __initramfs_size;
 
 static void __init free_initrd(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
 	unsigned long crashk_end   = (unsigned long)__va(crashk_res.end);
 #endif
 	if (do_retain_initrd)
 		goto skip;
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	/*
 	 * If the initrd region is overlapped with crashkernel reserved region,
 	 * free only memory that is not part of crashkernel region.
kernel/Makefile +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_MODULE_SIG) += module_signing.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
+obj-$(CONFIG_KEXEC_CORE) += kexec_core.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
kernel/events/core.c +1 -1
@@ -8872,7 +8872,7 @@ static void perf_event_init_cpu(int cpu)
 	mutex_unlock(&swhash->hlist_mutex);
 }
 
-#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC
+#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC_CORE
 static void __perf_event_exit_context(void *__info)
 {
 	struct remove_event re = { .detach_group = true };
kernel/kexec.c +1 -1577

1,612 lines not on this page · raw message

kernel/kexec_core.c new file +1594 -0

1,087 lines not on this page · raw message

kernel/ksysfs.c +3 -3

Lines of this file are not shown. View the raw message.

kernel/printk/printk.c +1 -1

Lines of this file are not shown. View the raw message.

kernel/reboot.c +1 -1

Lines of this file are not shown. View the raw message.

kernel/sysctl.c +1 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#3 lore raw

Re: [PATCH V2 2/2] kexec: split kexec_load syscall from kexec core code

Quoted 3 lines · On Mon, Jul 20, 2015 at 04:37:15PM +0800, [email protected] wrote:

Now there's two kexec load syscall, one is kexec_load another is kexec_file_load, kexec_file_load has been splited as kernel/kexec_file.c. In this patch I split kexec_load syscall code to kernel/kexec.c.

Hi Dave,

Nice work. Thanks for doing this. I have couple of minor comments.

- We might have to audit kernel/kexec_core.c. I think there are some functions in there which are used by only old syscall and not the new one. All that code should be in kernel/kexec.c. Only the code which is shared between two syscalls should be in kernel/kexec_core.c.

For example, I think kimage_alloc_init() is used by old syscall only. New syscall uses kimage_file_alloc_init().

[..]

Quoted 12 lines
include/linux/kexec.h +1 -1
@@ -16,7 +16,7 @@
 
 #include <uapi/linux/kexec.h>
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/list.h>
 #include <linux/linkage.h>
 #include <linux/compat.h>

include/linux/kexec.h int crash_shrink_memory(unsigned long ne · line 326

Quoted 10 lines
include/linux/kexec.h +6 -1
@@ -318,12 +318,18 @@ int crash_shrink_memory(unsigned long ne
 size_t crash_get_memory_size(void);
 void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
 
-#else /* !CONFIG_KEXEC */
+#ifdef CONFIG_KEXEC
+int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
+			     unsigned long nr_segments,
+			     struct kexec_segment __user *segments,
+			     unsigned long flags);
+#endif

I am wondering why this needs to be in kexec.h. Who needs this? Even if somebody needs this, this should probably be outside of KEXEC_CORE.

#ifdef CONFIG_KEXEC
int kimage_alloc_init(struct kimage **rimage, unsigned long entry,.... #else
#endif

#ifdef CONFIG_KEXEC_CORE
.
..

Thanks
Vivek

author
#4 lore raw

Re: [PATCH V2 2/2] kexec: split kexec_load syscall from kexec core code

Quoted 9 lines · Vivek Goyal
Quoted 3 lines · On Mon, Jul 20, 2015 at 04:37:15PM +0800, [email protected] wrote:

Now there's two kexec load syscall, one is kexec_load another is kexec_file_load, kexec_file_load has been splited as kernel/kexec_file.c. In this patch I split kexec_load syscall code to kernel/kexec.c.

Hi Dave,

Nice work. Thanks for doing this. I have couple of minor comments.

Quoted 7 lines

- We might have to audit kernel/kexec_core.c. I think there are some functions in there which are used by only old syscall and not the new one. All that code should be in kernel/kexec.c. Only the code which is shared between two syscalls should be in kernel/kexec_core.c.

For example, I think kimage_alloc_init() is used by old syscall only. New syscall uses kimage_file_alloc_init().

You are right, actually two functions copy_user_segment_list and kimage_alloc_init are used by kexec.c only

Will move them to kexec.c from kexec_core.c, it works well during my testing

Quoted 17 lines

[..]

Quoted 15 lines
include/linux/kexec.h +1 -1
@@ -16,7 +16,7 @@
 
 #include <uapi/linux/kexec.h>
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/list.h>
 #include <linux/linkage.h>
 #include <linux/compat.h>
@@ -318,12 +318,18 @@ int crash_shrink_memory(unsigned long ne
 size_t crash_get_memory_size(void);
 void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
 
Quoted 10 lines

include/linux/kexec.h int crash_shrink_memory(unsigned long ne · line 326

Quoted 7 lines
include/linux/kexec.h +6 -1
-#else /* !CONFIG_KEXEC */
+#ifdef CONFIG_KEXEC
+int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
+			     unsigned long nr_segments,
+			     struct kexec_segment __user *segments,
+			     unsigned long flags);
+#endif

I am wondering why this needs to be in kexec.h. Who needs this? Even if somebody needs this, this should probably be outside of KEXEC_CORE.

It was added here in 1st version before adding kexec_internal.h, later I moved most of them to kexec_internal.h, but yes it is not used by any file other than kexec.c, will drop this chunk.

Thanks a lot
Dave

author
#5 lore raw

Re: [PATCH V2 2/2 update] kexec: split kexec_load syscall from kexec core code

In reply to [email protected]

Now there's two kexec load syscall, one is kexec_load another is kexec_file_load, kexec_file_load has been splited as kernel/kexec_file.c. In this patch I split kexec_load syscall code to kernel/kexec.c.

And add a new kconfig option KEXEC_CORE, so we can disable kexec_load and use kexec_file_load only, or vice verse.

The original requirement is from Tedso, he want kexec kernel signature being checked with CONFIG_KEXEC_VERIFY_SIG enabled. But kexec-tools use kexec_load syscall can bypass the checking.

Vivek Goyal proposed to create a common kconfig option so user can compile in only one syscall for loading kexec kernel. KEXEC/KEXEC_FILE selects KEXEC_CORE so that old config files still work.

Because there's general code need CONFIG_KEXEC_CORE, so I updated all the architecture Kconfig with a new option KEXEC_CORE, and let KEXEC selects KEXEC_CORE in arch Kconfig. Also updated general kernel code with to kexec_load syscall.

---

Update per comments from Vivek:
- Moved below functions which are used by kexec_load only to kexec.c copy_user_segment_list() and kimage_alloc_init()
- add slab.h to kexec.c because kimage_alloc_init will call kfree
- drop unused declaration of kimage_alloc_init in kexec.h

 arch/Kconfig                  |    3 
 arch/arm/Kconfig              |    1 
 arch/ia64/Kconfig             |    1 
 arch/m68k/Kconfig             |    1 
 arch/mips/Kconfig             |    1 
 arch/powerpc/Kconfig          |    1 
 arch/s390/Kconfig             |    1 
 arch/sh/Kconfig               |    1 
 arch/tile/Kconfig             |    1 
 arch/x86/Kconfig              |    3 
 arch/x86/boot/header.S        |    2 
 arch/x86/include/asm/kdebug.h |    2 
 arch/x86/kernel/Makefile      |    4 
 arch/x86/kernel/kvmclock.c    |    4 
 arch/x86/kernel/reboot.c      |    4 
 arch/x86/kernel/setup.c       |    2 
 arch/x86/kernel/vmlinux.lds.S |    2 
 arch/x86/kvm/vmx.c            |    8 
 arch/x86/platform/efi/efi.c   |    4 
 arch/x86/platform/uv/uv_nmi.c |    6 
 drivers/firmware/efi/Kconfig  |    2 
 drivers/pci/pci-driver.c      |    2 
 include/linux/kexec.h         |    6 
 init/initramfs.c              |    4 
 kernel/Makefile               |    1 
 kernel/events/core.c          |    2 
 kernel/kexec.c                | 1496 -----------------------------------------
 kernel/kexec_core.c           | 1511 ++++++++++++++++++++++++++++++++++++++++++
 kernel/ksysfs.c               |    6 
 kernel/printk/printk.c        |    2 
 kernel/reboot.c               |    2 
 kernel/sysctl.c               |    2 
 32 files changed, 1560 insertions(+), 1528 deletions(-)
 create mode 100644 kernel/kexec_core.c
arch/Kconfig +3 -0
@@ -2,6 +2,9 @@
 # General architecture dependent options
 #
 
+config KEXEC_CORE
+	bool
+
 config OPROFILE
 	tristate "OProfile system profiling"
 	depends on PROFILING
arch/arm/Kconfig +1 -0
@@ -2005,6 +2005,7 @@ config KEXEC
 	bool "Kexec system call (EXPERIMENTAL)"
 	depends on (!SMP || PM_SLEEP_SMP)
 	depends on !CPU_V7M
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/ia64/Kconfig +1 -0
@@ -518,6 +518,7 @@ source "drivers/sn/Kconfig"
 config KEXEC
 	bool "kexec system call"
 	depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/m68k/Kconfig +1 -0
@@ -95,6 +95,7 @@ config MMU_SUN3
 config KEXEC
 	bool "kexec system call"
 	depends on M68KCLASSIC
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/mips/Kconfig +1 -0
@@ -2592,6 +2592,7 @@ source "kernel/Kconfig.preempt"
 
 config KEXEC
 	bool "Kexec system call"
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/powerpc/Kconfig +1 -0
@@ -415,6 +415,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
 config KEXEC
 	bool "kexec system call"
 	depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP))
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/s390/Kconfig +1 -0
@@ -48,6 +48,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 
 config KEXEC
 	def_bool y
+	select KEXEC_CORE
 
 config AUDIT_ARCH
 	def_bool y
arch/sh/Kconfig +1 -0
@@ -602,6 +602,7 @@ source kernel/Kconfig.hz
 config KEXEC
 	bool "kexec system call (EXPERIMENTAL)"
 	depends on SUPERH32 && MMU
+	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/tile/Kconfig +1 -0
@@ -204,6 +204,7 @@ source "kernel/Kconfig.hz"
 
 config KEXEC
 	bool "kexec system call"
+	select KEXEC_CORE
 	---help---
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/x86/Kconfig +2 -1
@@ -1724,6 +1724,7 @@ source kernel/Kconfig.hz
 
 config KEXEC
 	bool "kexec system call"
+	select KEXEC_CORE
 	---help---
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
@@ -1740,8 +1741,8 @@ config KEXEC
 
 config KEXEC_FILE
 	bool "kexec file based system call"
+	select KEXEC_CORE
 	select BUILD_BIN2C
-	depends on KEXEC
 	depends on X86_64
 	depends on CRYPTO=y
 	depends on CRYPTO_SHA256=y
arch/x86/boot/header.S +1 -1
@@ -414,7 +414,7 @@ xloadflags:
 # define XLF23 0
 #endif
 
-#if defined(CONFIG_X86_64) && defined(CONFIG_EFI) && defined(CONFIG_KEXEC)
+#if defined(CONFIG_X86_64) && defined(CONFIG_EFI) && defined(CONFIG_KEXEC_CORE)
 # define XLF4 XLF_EFI_KEXEC
 #else
 # define XLF4 0
arch/x86/include/asm/kdebug.h +1 -1
@@ -29,7 +29,7 @@ extern void show_trace(struct task_struc
 extern void __show_regs(struct pt_regs *regs, int all);
 extern unsigned long oops_begin(void);
 extern void oops_end(unsigned long, struct pt_regs *, int signr);
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 extern int in_crash_kexec;
 #else
 /* no crash dump is ever in progress if no crash kernel can be kexec'd */
arch/x86/kernel/Makefile +2 -2
@@ -69,8 +69,8 @@ obj-$(CONFIG_LIVEPATCH)		+= livepatch.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
 obj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
 obj-$(CONFIG_X86_TSC)		+= trace_clock.o
-obj-$(CONFIG_KEXEC)		+= machine_kexec_$(BITS).o
-obj-$(CONFIG_KEXEC)		+= relocate_kernel_$(BITS).o crash.o
+obj-$(CONFIG_KEXEC_CORE)	+= machine_kexec_$(BITS).o
+obj-$(CONFIG_KEXEC_CORE)	+= relocate_kernel_$(BITS).o crash.o
 obj-$(CONFIG_KEXEC_FILE)	+= kexec-bzimage64.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump_$(BITS).o
 obj-y				+= kprobes/
arch/x86/kernel/kvmclock.c +2 -2
@@ -200,7 +200,7 @@ static void kvm_setup_secondary_clock(vo
  * kind of shutdown from our side, we unregister the clock by writting anything
  * that does not have the 'enable' bit set in the msr
  */
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 static void kvm_crash_shutdown(struct pt_regs *regs)
 {
 	native_write_msr(msr_kvm_system_time, 0, 0);
@@ -259,7 +259,7 @@ void __init kvmclock_init(void)
 	x86_platform.save_sched_clock_state = kvm_save_sched_clock_state;
 	x86_platform.restore_sched_clock_state = kvm_restore_sched_clock_state;
 	machine_ops.shutdown  = kvm_shutdown;
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	machine_ops.crash_shutdown  = kvm_crash_shutdown;
 #endif
 	kvm_get_preset_lpj();
arch/x86/kernel/reboot.c +2 -2
@@ -673,7 +673,7 @@ struct machine_ops machine_ops = {
 	.emergency_restart = native_machine_emergency_restart,
 	.restart = native_machine_restart,
 	.halt = native_machine_halt,
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	.crash_shutdown = native_machine_crash_shutdown,
 #endif
 };
@@ -703,7 +703,7 @@ void machine_halt(void)
 	machine_ops.halt();
 }
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 void machine_crash_shutdown(struct pt_regs *regs)
 {
 	machine_ops.crash_shutdown(regs);
arch/x86/kernel/setup.c +1 -1
@@ -498,7 +498,7 @@ static void __init memblock_x86_reserve_
  * --------- Crashkernel reservation ------------------------------
  */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 
 /*
  * Keep the crash kernel below this limit.  On 32 bits earlier kernels
arch/x86/kernel/vmlinux.lds.S +1 -1
@@ -364,7 +364,7 @@ INIT_PER_CPU(irq_stack_union);
 
 #endif /* CONFIG_X86_32 */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <asm/kexec.h>
 
 . = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
arch/x86/kvm/vmx.c +4 -4
@@ -1264,7 +1264,7 @@ static void vmcs_load(struct vmcs *vmcs)
 		       vmcs, phys_addr);
 }
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 /*
  * This bitmap is used to indicate whether the vmclear
  * operation is enabled on all cpus. All disabled by
@@ -1302,7 +1302,7 @@ static void crash_vmclear_local_loaded_v
 #else
 static inline void crash_enable_local_vmclear(int cpu) { }
 static inline void crash_disable_local_vmclear(int cpu) { }
-#endif /* CONFIG_KEXEC */
+#endif /* CONFIG_KEXEC_CORE */
 
 static void __loaded_vmcs_clear(void *arg)
 {
@@ -10425,7 +10425,7 @@ static int __init vmx_init(void)
 	if (r)
 		return r;
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	rcu_assign_pointer(crash_vmclear_loaded_vmcss,
 			   crash_vmclear_local_loaded_vmcss);
 #endif
@@ -10435,7 +10435,7 @@ static int __init vmx_init(void)
 
 static void __exit vmx_exit(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	RCU_INIT_POINTER(crash_vmclear_loaded_vmcss, NULL);
 	synchronize_rcu();
 #endif
arch/x86/platform/efi/efi.c +2 -2
@@ -650,7 +650,7 @@ static void __init get_systab_virt_addr(
 
 static void __init save_runtime_map(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	efi_memory_desc_t *md;
 	void *tmp, *p, *q = NULL;
 	int count = 0;
@@ -748,7 +748,7 @@ static void * __init efi_map_regions(int
 
 static void __init kexec_enter_virtual_mode(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	efi_memory_desc_t *md;
 	void *p;
 
arch/x86/platform/uv/uv_nmi.c +3 -3
@@ -492,7 +492,7 @@ static void uv_nmi_touch_watchdogs(void)
 	touch_nmi_watchdog();
 }
 
-#if defined(CONFIG_KEXEC)
+#if defined(CONFIG_KEXEC_CORE)
 static atomic_t uv_nmi_kexec_failed;
 static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
 {
@@ -519,13 +519,13 @@ static void uv_nmi_kdump(int cpu, int ma
 	uv_nmi_sync_exit(0);
 }
 
-#else /* !CONFIG_KEXEC */
+#else /* !CONFIG_KEXEC_CORE */
 static inline void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
 {
 	if (master)
 		pr_err("UV: NMI kdump: KEXEC not supported in this kernel\n");
 }
-#endif /* !CONFIG_KEXEC */
+#endif /* !CONFIG_KEXEC_CORE */
 
 #ifdef CONFIG_KGDB
 #ifdef CONFIG_KGDB_KDB
drivers/firmware/efi/Kconfig +1 -1
@@ -43,7 +43,7 @@ config EFI_VARS_PSTORE_DEFAULT_DISABLE
 
 config EFI_RUNTIME_MAP
 	bool "Export efi runtime maps to sysfs"
-	depends on X86 && EFI && KEXEC
+	depends on X86 && EFI && KEXEC_CORE
 	default y
 	help
 	  Export efi runtime memory maps to /sys/firmware/efi/runtime-map.
drivers/pci/pci-driver.c +1 -1
@@ -453,7 +453,7 @@ static void pci_device_shutdown(struct d
 	pci_msi_shutdown(pci_dev);
 	pci_msix_shutdown(pci_dev);
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	/*
 	 * If this is a kexec reboot, turn off Bus Master bit on the
 	 * device to tell it to not continue to do DMA. Don't touch
include/linux/kexec.h +3 -3
@@ -16,7 +16,7 @@
 
 #include <uapi/linux/kexec.h>
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/list.h>
 #include <linux/linkage.h>
 #include <linux/compat.h>
@@ -318,12 +318,12 @@ int crash_shrink_memory(unsigned long ne
 size_t crash_get_memory_size(void);
 void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
 
-#else /* !CONFIG_KEXEC */
+#else /* !CONFIG_KEXEC_CORE */
 struct pt_regs;
 struct task_struct;
 static inline void crash_kexec(struct pt_regs *regs) { }
 static inline int kexec_should_crash(struct task_struct *p) { return 0; }
-#endif /* CONFIG_KEXEC */
+#endif /* CONFIG_KEXEC_CORE */
 
 #endif /* !defined(__ASSEBMLY__) */
 
init/initramfs.c +2 -2
@@ -526,14 +526,14 @@ extern unsigned long __initramfs_size;
 
 static void __init free_initrd(void)
 {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
 	unsigned long crashk_end   = (unsigned long)__va(crashk_res.end);
 #endif
 	if (do_retain_initrd)
 		goto skip;
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	/*
 	 * If the initrd region is overlapped with crashkernel reserved region,
 	 * free only memory that is not part of crashkernel region.
kernel/Makefile +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_MODULE_SIG) += module_signing.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
+obj-$(CONFIG_KEXEC_CORE) += kexec_core.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
kernel/events/core.c +1 -1
@@ -8872,7 +8872,7 @@ static void perf_event_init_cpu(int cpu)
 	mutex_unlock(&swhash->hlist_mutex);
 }
 
-#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC
+#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC_CORE
 static void __perf_event_exit_context(void *__info)
 {
 	struct remove_event re = { .detach_group = true };
kernel/kexec.c +2 -1494

1,542 lines not on this page · raw message

kernel/kexec_core.c new file +1511 -0

1,163 lines not on this page · raw message

kernel/ksysfs.c +3 -3

Lines of this file are not shown. View the raw message.

kernel/printk/printk.c +1 -1

Lines of this file are not shown. View the raw message.

kernel/reboot.c +1 -1

Lines of this file are not shown. View the raw message.

kernel/sysctl.c +1 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

author
#6 lore raw

Re: [PATCH V2 2/2 update] kexec: split kexec_load syscall from kexec core code

Quoted 8 lines · Dave Young

---

Update per comments from Vivek:
- Moved below functions which are used by kexec_load only to kexec.c copy_user_segment_list() and kimage_alloc_init()
- add slab.h to kexec.c because kimage_alloc_init will call kfree
- drop unused declaration of kimage_alloc_init in kexec.h

[snip]

Andrew, I noticed you have taken the two patches in -mm, could you replace the 2/2 with this update, there's small cleanup per Vivek's comments, detail changes see above.

BTW, sorry I forgot to remove the "Re: " before "[PATCH]" prefix.

Thanks
Dave

thanks
Dave