summaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2014-07-28kexec-support-kexec-kdump-on-efi-systems-fixAndrew Morton
s/get_efi/efi_get/g, per Matt Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Matt Fleming <matt@console-pimps.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec: support kexec/kdump on EFI systemsVivek Goyal
This patch does two things. It passes EFI run time mappings to second kernel in bootparams efi_info. Second kernel parse this info and create new mappings in second kernel. That means mappings in first and second kernel will be same. This paves the way to enable EFI in kexec kernel. This patch also prepares and passes EFI setup data through bootparams. This contains bunch of information about various tables and their addresses. These information gathering and passing has been written along the lines of what current kexec-tools is doing to make kexec work with UEFI. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Matt Fleming <matt@console-pimps.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec-bzimage64: fix the ordering of registersVivek Goyal
hpa suggested to fix the ordering of register declaration. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec: support for kexec on panic using new system callVivek Goyal
This patch adds support for loading a kexec on panic (kdump) kernel usning new system call. It prepares ELF headers for memory areas to be dumped and for saved cpu registers. Also prepares the memory map for second kernel and limits its boot to reserved areas only. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec: fix freeing up for image loader data loadingVivek Goyal
During testing I noticed a crash. Which in turn showed that there are problems with how I am freeing up image->image_loader_data. In one case I am freeing up kimage->image_loader_data first and then calling up arch to free up which might have been contained in that structure. That's wrong. I have done little cleanup and this should fix the issues around freeing up of loader data. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec-bzImage64: support for loading bzImage using 64bit entryVivek Goyal
This is loader specific code which can load bzImage and set it up for 64bit entry. This does not take care of 32bit entry or real mode entry. 32bit mode entry can be implemented if somebody needs it. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec-load-and-relocate-purgatory-at-kernel-load-time-fixVivek Goyal
Set CRYPTO=y and CRYPTO_SHA256=y for all arch supporting kexec. Generic kexec implementation now makes use of crypto API to calculate the sha256 digest of loaded kernel segments (for new syscall kexec_file_load()). That means one need to enforce that CRYPTO and CRYPTO_SHA256 are built in for kexec to compile and for new syscall to work. I created this dependency for x86 but forgot to do for other arches supporting kexec. And ran into compilation failure reports from kbuild test robot. kernel/built-in.o: In function `sys_kexec_file_load': (.text+0x32314): undefined reference to `crypto_shash_final' kernel/built-in.o: In function `sys_kexec_file_load': (.text+0x32328): undefined reference to `crypto_shash_update' kernel/built-in.o: In function `sys_kexec_file_load': >> (.text+0x32338): undefined reference to `crypto_alloc_shash' Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec: load and relocate purgatory at kernel load timeVivek Goyal
Load purgatory code in RAM and relocate it based on the location. Relocation code has been inspired by module relocation code and purgatory relocation code in kexec-tools. Also compute the checksums of loaded kexec segments and store them in purgatory. Arch independent code provides this functionality so that arch dependent bootloaders can make use of it. Helper functions are provided to get/set symbol values in purgatory which are used by bootloaders later to set things like stack and entry point of second kernel etc. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28purgatory: run host built programs from objtreeStephen Rothwell
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28purgatory: core purgatory functionalityVivek Goyal
Create a stand alone relocatable object purgatory which runs between two kernels. This name, concept and some code has been taken from kexec-tools. Idea is that this code runs after a crash and it runs in minimal environment. So keep it separate from rest of the kernel and in long term we will have to practically do no maintenance of this code. This code also has the logic to do verify sha256 hashes of various segments which have been loaded into memory. So first we verify that the kernel we are jumping to is fine and has not been corrupted and make progress only if checsums are verified. This code also takes care of copying some memory contents to backup region. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28purgatory/sha256: provide implementation of sha256 in purgaotory contextVivek Goyal
Next two patches provide code for purgatory. This is a code which does not link against the kernel and runs stand alone. This code runs between two kernels. One of the primary purpose of this code is to verify the digest of newly loaded kernel and making sure it matches the digest computed at kernel load time. We use sha256 for calculating digest of kexec segmetns. Purgatory can't use stanard crypto API as that API is not available in purgatory context. Hence, I have copied code from crypto/sha256_generic.c and compiled it with purgaotry code so that it could be used. I could not #include sha256_generic.c file here as some of the function signature requiered little tweaking. Original functions work with crypto API but these ones don't So instead of doing #include on sha256_generic.c I just copied relevant portions of code into arch/x86/purgatory/sha256.c. Now we shouldn't have to touch this code at all. Do let me know if there are better ways to handle it. This patch does not enable compiling of this code. That happens in next patch. I wanted to highlight this change in a separate patch for easy review. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec: implementation of new syscall kexec_file_loadVivek Goyal
Previous patch provided the interface definition and this patch prvides implementation of new syscall. Previously segment list was prepared in user space. Now user space just passes kernel fd, initrd fd and command line and kernel will create a segment list internally. This patch contains generic part of the code. Actual segment preparation and loading is done by arch and image specific loader. Which comes in next patch. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kexec: new syscall kexec_file_load() declarationVivek Goyal
This is the new syscall kexec_file_load() declaration/interface. I have reserved the syscall number only for x86_64 so far. Other architectures (including i386) can reserve syscall number when they enable the support for this new syscall. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Borislav Petkov <bp@suse.de> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28kernel: build bin2c based on config option CONFIG_BUILD_BIN2CVivek Goyal
currently bin2c builds only if CONFIG_IKCONFIG=y. But bin2c will now be used by kexec too. So make it compilation dependent on CONFIG_BUILD_BIN2C and this config option can be selected by CONFIG_KEXEC and CONFIG_IKCONFIG. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28arch/x86: replace strict_strto callsDaniel Walter
Replace obsolete strict_strto calls with appropriate kstrto calls Signed-off-by: Daniel Walter <dwalter@google.com> Acked-by: Borislav Petkov <bp@suse.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28arch/powerpc: replace obsolete strict_strto* callsDaniel Walter
Replace strict_strto calls with more appropriate kstrto calls Signed-off-by: Daniel Walter <dwalter@google.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28arch/arm/mach-w90x900/cpu.c: replace obsolete strict_strtoDaniel Walter
Replace obsolete strict_strto with kstrto calls Signed-off-by: Daniel Walter <dwalter@google.com> Cc: Wan ZongShun <mcuos.com@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28arch/arm/mach-s3c24xx/mach-jive.c: replace strict_strto* with kstrto*Daniel Walter
Replace obsolete strict_strto call with kstrto Signed-off-by: Daniel Walter <dwalter@google.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28arch/arm/mach-pxa: replace strict_strto call with kstrtoDaniel Walter
Replace obsolete call to strict_strto with kstrto Signed-off-by: Daniel Walter <dwalter@google.com> Cc: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28arch/arm/mach-omap2: replace strict_strto* with kstrto*Daniel Walter
Replace obsolete strict_strto call with kstrto calls. Simplify copy_from_user/strict_strto by using kstrto_from_user Signed-off-by: Daniel Walter <dwalter@google.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-28Merge branch 'akpm-current/current'Stephen Rothwell
Conflicts: arch/arm64/Kconfig mm/shmem.c
2014-07-28Merge remote-tracking branch 'signal-cleanup/signal_v4'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'random/dev'Stephen Rothwell
Conflicts: arch/x86/syscalls/syscall_32.tbl arch/x86/syscalls/syscall_64.tbl drivers/char/hw_random/core.c include/linux/syscalls.h include/uapi/asm-generic/unistd.h
2014-07-28Merge remote-tracking branch 'clk/clk-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'pinctrl/for-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'scsi/for-next'Stephen Rothwell
Conflicts: drivers/scsi/cxgbi/libcxgbi.h include/scsi/sg.h
2014-07-28Merge remote-tracking branch 'staging/staging-next'Stephen Rothwell
Conflicts: drivers/staging/cxt1e1/linux.c drivers/staging/dgrp/dgrp_tty.c drivers/staging/media/sn9c102/Kconfig
2014-07-28Merge remote-tracking branch 'usb/usb-next'Stephen Rothwell
Conflicts: Documentation/devicetree/bindings/phy/samsung-phy.txt drivers/phy/Kconfig drivers/phy/Makefile drivers/phy/phy-samsung-usb2.c drivers/phy/phy-samsung-usb2.h drivers/usb/musb/musb_host.c
2014-07-28Merge remote-tracking branch 'tty/tty-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'driver-core/driver-core-next'Stephen Rothwell
Conflicts: arch/arm/mach-shmobile/board-genmai.c arch/arm/mach-shmobile/setup-r7s72100.c drivers/gpu/drm/armada/armada_crtc.c
2014-07-28Merge remote-tracking branch 'xen-tip/linux-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'kvm-ppc/kvm-ppc-next'Stephen Rothwell
Conflicts: Documentation/virtual/kvm/api.txt
2014-07-28Merge remote-tracking branch 'kvm/linux-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'ftrace/for-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'irqchip/irqchip/for-next'Stephen Rothwell
Conflicts: arch/arm64/Kconfig drivers/irqchip/irq-gic.c
2014-07-28Merge remote-tracking branch 'clockevents/clockevents/next'Stephen Rothwell
2014-07-28next-20140724/tipStephen Rothwell
2014-07-28Merge remote-tracking branch 'spi/for-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'devicetree/devicetree/next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'audit/master'Stephen Rothwell
Conflicts: arch/mips/include/asm/syscall.h arch/mips/kernel/ptrace.c arch/powerpc/Kconfig arch/x86/Kconfig kernel/audit.c
2014-07-28Merge remote-tracking branch 'trivial/for-next'Stephen Rothwell
Conflicts: Documentation/laptops/freefall.c arch/arm/mach-msm/Kconfig
2014-07-28Merge remote-tracking branch 'security/next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'block/for-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'sound-asoc/for-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'crypto/master'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'net-next/master'Stephen Rothwell
Conflicts: drivers/net/wireless/iwlwifi/mvm/mac80211.c net/mac80211/cfg.c
2014-07-28Merge remote-tracking branch 'pm/linux-next'Stephen Rothwell
Conflicts: drivers/acpi/acpi_extlog.c
2014-07-28Merge remote-tracking branch 'kbuild/for-next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'pci/next'Stephen Rothwell
2014-07-28Merge remote-tracking branch 'uml/next'Stephen Rothwell
Conflicts: arch/um/include/asm/Kbuild