diff options
author | Dave Young <dyoung@redhat.com> | 2015-09-09 18:38:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 16:29:01 -0400 |
commit | 2965faa5e03d1e71e9ff9aa143fff39e0a77543a (patch) | |
tree | 78b12008d7078a9cd40e157d5b18b795b14d5d9c /init | |
parent | a43cac0d9dc2073ff2245a171429ddbe1accece7 (diff) |
kexec: split kexec_load syscall from kexec core code
There are two kexec load syscalls, kexec_load another and 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 Ted Ts'o, 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.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Dave Young <dyoung@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Petr Tesarik <ptesarik@suse.cz>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r-- | init/initramfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index ad1bd7787bbb..b32ad7d97ac9 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -526,14 +526,14 @@ extern unsigned long __initramfs_size; | |||
526 | 526 | ||
527 | static void __init free_initrd(void) | 527 | static void __init free_initrd(void) |
528 | { | 528 | { |
529 | #ifdef CONFIG_KEXEC | 529 | #ifdef CONFIG_KEXEC_CORE |
530 | unsigned long crashk_start = (unsigned long)__va(crashk_res.start); | 530 | unsigned long crashk_start = (unsigned long)__va(crashk_res.start); |
531 | unsigned long crashk_end = (unsigned long)__va(crashk_res.end); | 531 | unsigned long crashk_end = (unsigned long)__va(crashk_res.end); |
532 | #endif | 532 | #endif |
533 | if (do_retain_initrd) | 533 | if (do_retain_initrd) |
534 | goto skip; | 534 | goto skip; |
535 | 535 | ||
536 | #ifdef CONFIG_KEXEC | 536 | #ifdef CONFIG_KEXEC_CORE |
537 | /* | 537 | /* |
538 | * If the initrd region is overlapped with crashkernel reserved region, | 538 | * If the initrd region is overlapped with crashkernel reserved region, |
539 | * free only memory that is not part of crashkernel region. | 539 | * free only memory that is not part of crashkernel region. |