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

2015-07-21 Thread Dave Young
On 07/22/15 at 10:19am, Dave Young wrote:
> ---
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-07-21 Thread Dave Young
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.

Signed-off-by: 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

 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

--- linux.orig/arch/Kconfig
+++ linux/arch/Kconfig
@@ -2,6 +2,9 @@
 # General architecture dependent options
 #
 
+config KEXEC_CORE
+   bool
+
 config OPROFILE
tristate "OProfile system profiling"
depends on PROFILING
--- linux.orig/arch/arm/Kconfig
+++ linux/arch/arm/Kconfig
@@ -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
--- linux.orig/arch/ia64/Kconfig
+++ linux/arch/ia64/Kconfig
@@ -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
--- linux.orig/arch/m68k/Kconfig
+++ linux/arch/m68k/Kconfig
@@ -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
--- linux.orig/arch/mips/Kconfig
+++ linux/arch/mips/Kconfig
@@ -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
--- linux.orig/arch/powerpc/Kconfig
+++ linux/arch/powerpc/Kconfig
@@ -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
--- linux.orig/arch/s390/Kconfig
+++ linux/arch/s390/Kconfig
@@ -48,6 +48,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 
 

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

2015-07-21 Thread Dave Young
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.

Signed-off-by: Dave Young dyo...@redhat.com
---

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

--- linux.orig/arch/Kconfig
+++ linux/arch/Kconfig
@@ -2,6 +2,9 @@
 # General architecture dependent options
 #
 
+config KEXEC_CORE
+   bool
+
 config OPROFILE
tristate OProfile system profiling
depends on PROFILING
--- linux.orig/arch/arm/Kconfig
+++ linux/arch/arm/Kconfig
@@ -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
--- linux.orig/arch/ia64/Kconfig
+++ linux/arch/ia64/Kconfig
@@ -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
--- linux.orig/arch/m68k/Kconfig
+++ linux/arch/m68k/Kconfig
@@ -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
--- linux.orig/arch/mips/Kconfig
+++ linux/arch/mips/Kconfig
@@ -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
--- linux.orig/arch/powerpc/Kconfig
+++ linux/arch/powerpc/Kconfig
@@ -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
--- linux.orig/arch/s390/Kconfig
+++ linux/arch/s390/Kconfig
@@ -48,6 +48,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 
 

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

2015-07-21 Thread Dave Young
On 07/22/15 at 10:19am, Dave Young wrote:
 ---
 
 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
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/