[PATCH v7 04/13] powerpc: Change places using CONFIG_KEXEC to use CONFIG_KEXEC_CORE instead.

2016-08-30 Thread Thiago Jung Bauermann
RE instead, since kexec_file_load also needs that code compiled in. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/debug.h | 2 +- arch/powerpc/include/asm/kexec.h | 6 +++--- arch/powerpc/include/asm

[PATCH v4 5/5] IMA: Demonstration code for kexec buffer passing.

2016-08-30 Thread Thiago Jung Bauermann
This shows how kernel code can use the kexec buffer passing mechanism to pass information to the next kernel. This patch is not intended to be committed. [a...@linux-foundation.org: coding-style fixes] Signed-off-by: Thiago Jung Bauermann Signed-off-by: Andrew Morton --- include/linux/ima.h

[PATCH v7 12/13] powerpc: Add purgatory for kexec_file_load implementation.

2016-08-30 Thread Thiago Jung Bauermann
that the purgatory can add those dot symbols. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Makefile | 4 + arch/powerpc/boot/string.S| 67 ++-- arch/powerpc/purgatory/.gitignore | 2 + arch/powerpc/purgatory/Makefile

[PATCH v4 3/5] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-30 Thread Thiago Jung Bauermann
nated initializers. Therefore, there is no behavior change with this patch and all segments except the purgatory are checksummed. Signed-off-by: Thiago Jung Bauermann --- include/linux/kexec.h | 23 ++- kernel/kexec_file.c | 15 +++ 2 files changed, 21 insertions(+

[PATCH v7 09/13] powerpc: Implement kexec_file_load.

2016-08-30 Thread Thiago Jung Bauermann
arch_kexec_walk_mem and arch_kexec_apply_relocations_add are used by generic kexec code, while setup_purgatory is powerpc-specific and sets runtime variables needed by the powerpc purgatory implementation. Signed-off-by: Josh Sklar Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig

[PATCH v4 2/5] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-30 Thread Thiago Jung Bauermann
The buffer hand-over mechanism allows the currently running kernel to pass data to kernel that will be kexec'd via a kexec segment. The second kernel can check whether the previous kernel sent data and retrieve it. This is the architecture-specific part. Signed-off-by: Thiago Jung Baue

[PATCH v4 1/5] kexec_file: Add buffer hand-over support for the next kernel

2016-08-30 Thread Thiago Jung Bauermann
hiago Jung Bauermann --- include/linux/kexec.h | 31 +++ kernel/kexec_file.c | 68 +++ 2 files changed, 99 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d419d0e51fe5..16561e96a6d7 100644 --- a/in

[PATCH v7 13/13] powerpc: Enable CONFIG_KEXEC_FILE in powerpc server defconfigs.

2016-08-30 Thread Thiago Jung Bauermann
Enable CONFIG_KEXEC_FILE in powernv_defconfig, ppc64_defconfig and pseries_defconfig. It depends on CONFIG_CRYPTO_SHA256=y, so add that as well. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/powernv_defconfig | 2 ++ arch/powerpc/configs/ppc64_defconfig | 2 ++ arch/powerpc

[PATCH v7 08/13] powerpc: Add functions to read ELF files of any endianness.

2016-08-30 Thread Thiago Jung Bauermann
ating the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 18 ++ arch/powerpc/kernel/Makefile| 2 +- arch/powerpc/kernel/elf_util.c | 476 ++

[PATCH v7 10/13] powerpc: Add code to work with device trees in kexec_file_load.

2016-08-30 Thread Thiago Jung Bauermann
kexec_file_load needs to set up the device tree that will be used by the next kernel and check whether it provides a console that can be used by the purgatory. [a...@linux-foundation.org: coding-style fixes] Signed-off-by: Thiago Jung Bauermann Signed-off-by: Andrew Morton --- arch/powerpc

[PATCH v4 0/5] kexec_file: Add buffer hand-over for the next kernel

2016-08-30 Thread Thiago Jung Bauermann
s NULL in kexec_update_segment. - Patch "IMA: Demonstration code for kexec buffer passing." - Avoid registering reboot notifier again if kexec_file_load is called more than once. Thiago Jung Bauermann (5): kexec_file: Add buffer hand-over support for the next kernel powerpc: ke

[PATCH v7 06/13] powerpc: Generalize elf64_apply_relocate_add.

2016-08-30 Thread Thiago Jung Bauermann
et at its final location by adding an addr_base argument to specify the address at which the section will be loaded, and rela, loc_base and syms_base to point to the sections' contents. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 6 ++-- arch/powerpc/kernel/

[PATCH v7 11/13] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-08-30 Thread Thiago Jung Bauermann
Mohan Kumar M (mo...@in.ibm.com) + * Copyright (C) 2016 IBM Corporation + * + * Based on kexec-tools' kexec-elf-exec.c and kexec-elf-ppc64.c. + * Heavily modified for the kernel by + * Thiago Jung Bauermann . + * + * This program is free software; you can redistribute it and/or modify + * it

[PATCH v7 03/13] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-08-30 Thread Thiago Jung Bauermann
kexec_locate_mem_hole will be used by the PowerPC kexec_file_load implementation to find free memory for the purgatory stack. Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Young --- include/linux/kexec.h | 1 + kernel/kexec_file.c | 25 - 2 files changed, 21

[PATCH v4 4/5] kexec_file: Add mechanism to update kexec segments.

2016-08-30 Thread Thiago Jung Bauermann
kexec_update_segment allows a given segment in kexec_image to have its contents updated. This is useful if the current kernel wants to send information to the next kernel that is up-to-date at the time of reboot. Signed-off-by: Thiago Jung Bauermann --- include/linux/kexec.h | 2 ++ kernel

[PATCH v7 05/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-30 Thread Thiago Jung Bauermann
alled from elf64_apply_relocate_add. local_entry_offset and squash_toc_save_inst were only used by apply_rellocate_add, so they were moved to elf_util_64.c as well. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 70 arch/powerpc/include/asm/module.h

[PATCH v7 07/13] powerpc: Adapt elf64_apply_relocate_add for kexec_file_load.

2016-08-30 Thread Thiago Jung Bauermann
fixes] Signed-off-by: Thiago Jung Bauermann Signed-off-by: Andrew Morton --- arch/powerpc/include/asm/elf_util.h | 2 + arch/powerpc/kernel/elf_util_64.c | 100 +--- arch/powerpc/kernel/module_64.c | 6 ++- 3 files changed, 99 insertions(+), 9 deletions

[PATCH v7 00/13] kexec_file_load implementation for PowerPC

2016-08-30 Thread Thiago Jung Bauermann
C64_ELF_ABI_v2 macro. Changes for v2: - All patches: forgot to add Signed-off-by lines in v1, so added them now. - Patch "kexec_file: Generalize kexec_add_buffer.": broke in two, one adding arch_kexec_walk_mem and the other adding kexec_locate_mem_hole. - Patch "powerpc: Implement

[PATCH v3 2/5] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-25 Thread Thiago Jung Bauermann
The buffer hand-over mechanism allows the currently running kernel to pass data to kernel that will be kexec'd via a kexec segment. The second kernel can check whether the previous kernel sent data and retrieve it. This is the architecture-specific part. Signed-off-by: Thiago Jung Baue

Re: [PATCH v3 0/5] kexec_file: Add buffer hand-over for the next kernel

2016-08-25 Thread Thiago Jung Bauermann
ce the "ima: carry the > measurement list across kexec" series has stabilised, I should drop the > demo patch and also grab those? If so, pelase start cc'ing me. I'm not sure how Mimi is planning to upstream that series. -- []'s Thiago Jung Bauermann IBM Linux Technology Center

[PATCH v3 5/5] IMA: Demonstration code for kexec buffer passing.

2016-08-25 Thread Thiago Jung Bauermann
This shows how kernel code can use the kexec buffer passing mechanism to pass information to the next kernel. This patch is not intended to be committed. Signed-off-by: Thiago Jung Bauermann --- include/linux/ima.h | 11 + kernel/kexec_file.c | 4

[PATCH v3 1/5] kexec_file: Add buffer hand-over support for the next kernel

2016-08-25 Thread Thiago Jung Bauermann
hiago Jung Bauermann --- include/linux/kexec.h | 31 +++ kernel/kexec_file.c | 68 +++ 2 files changed, 99 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d419d0e51fe5..16561e96a6d7 100644 --- a/in

[PATCH v3 3/5] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-25 Thread Thiago Jung Bauermann
nated initializers. Therefore, there is no behavior change with this patch and all segments except the purgatory are checksummed. Signed-off-by: Thiago Jung Bauermann --- include/linux/kexec.h | 23 ++- kernel/kexec_file.c | 15 +++ 2 files changed, 21 insertions(+

[PATCH v3 4/5] kexec_file: Add mechanism to update kexec segments.

2016-08-25 Thread Thiago Jung Bauermann
kexec_update_segment allows a given segment in kexec_image to have its contents updated. This is useful if the current kernel wants to send information to the next kernel that is up-to-date at the time of reboot. Signed-off-by: Thiago Jung Bauermann --- include/linux/kexec.h | 2 ++ kernel

[PATCH v3 0/5] kexec_file: Add buffer hand-over for the next kernel

2016-08-25 Thread Thiago Jung Bauermann
heck if kexec_image is NULL in kexec_update_segment. - Patch "IMA: Demonstration code for kexec buffer passing." - Avoid registering reboot notifier again if kexec_file_load is called more than once. Thiago Jung Bauermann (5): kexec_file: Add buffer hand-over support for the next kernel

[PATCH] kexec: Fix double-free when failing to relocate the purgatory.

2016-08-25 Thread Thiago Jung Bauermann
to free a NULL pointer. Signed-off-by: Thiago Jung Bauermann --- kernel/kexec_file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 503bc2d348e5..037c321c5618 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -887,7 +887,10 @@ i

Re: [PATCH v5 04/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-23 Thread Thiago Jung Bauermann
mitation, cc'ing him > > I don't think it's ever worked so I wouldn't worry too much about > supporting it. Fixing kexec-into-zImage and fixing the 32bit wrapper > on 64bit BE kernel problem has been on my TODO list for a while, but > it's not a priority. Ok, thanks for your input. -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v5 04/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-22 Thread Thiago Jung Bauermann
Am Dienstag, 16 August 2016, 16:52:54 schrieb Balbir Singh: > On 16/08/16 09:25, Thiago Jung Bauermann wrote: > > Am Montag, 15 August 2016, 17:46:34 schrieb Balbir Singh: > >> On Thu, Aug 11, 2016 at 08:08:09PM -0300, Thiago Jung Bauermann wrote: > >>> +/** >

Re: [PATCH v2 2/6] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-22 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 15:22:00 schrieb Dave Young: > On 08/22/16 at 12:38am, Thiago Jung Bauermann wrote: > > Am Montag, 22 August 2016, 11:21:35 schrieb Dave Young: > > > On 08/13/16 at 12:18am, Thiago Jung Bauermann wrote: > > > > diff --git a/arch/pow

Re: [PATCH v2 3/6] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-22 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 11:36:43 schrieb Dave Young: > On 08/22/16 at 12:25am, Thiago Jung Bauermann wrote: > > Am Montag, 22 August 2016, 11:17:45 schrieb Dave Young: > > > On 08/18/16 at 06:09pm, Thiago Jung Bauermann wrote: > > > > Am Donnerstag, 18 August 201

Re: [PATCH v2 3/6] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-21 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 11:36:43 schrieb Dave Young: > On 08/22/16 at 12:25am, Thiago Jung Bauermann wrote: > > Am Montag, 22 August 2016, 11:17:45 schrieb Dave Young: > > > On 08/18/16 at 06:09pm, Thiago Jung Bauermann wrote: > > > > Hello Dave, > >

Re: [PATCH v2 2/6] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-21 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 11:21:35 schrieb Dave Young: > On 08/13/16 at 12:18am, Thiago Jung Bauermann wrote: > > diff --git a/arch/powerpc/kernel/machine_kexec_64.c > > b/arch/powerpc/kernel/machine_kexec_64.c index > > a484a6346146..190c652e49b7 100644 > >

Re: [PATCH v2 3/6] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-21 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 11:17:45 schrieb Dave Young: > On 08/18/16 at 06:09pm, Thiago Jung Bauermann wrote: > > Hello Dave, > > > > Thanks for your review! > > > > [ Trimming down Cc: list a little to try to clear the "too many > > recipients"

[PATCH v6 02/12] kexec_file: Change kexec_add_buffer to take kexec_buf as argument.

2016-08-19 Thread Thiago Jung Bauermann
existing casts to char * in the code. Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Young Acked-by: Balbir Singh --- arch/x86/kernel/crash.c | 37 arch/x86/kernel/kexec-bzimage64.c | 48 +++-- include/linux/kexec.h | 8 +--- kernel

[PATCH v6 00/12] kexec_file_load implementation for PowerPC

2016-08-19 Thread Thiago Jung Bauermann
dd_buffer.": broke in two, one adding arch_kexec_walk_mem and the other adding kexec_locate_mem_hole. - Patch "powerpc: Implement kexec_file_load.": - Moved relocation changes and the arch_kexec_walk_mem implementation to the next patch in the series. - Removed pr_fmt fro

[PATCH v6 01/12] kexec_file: Allow arch-specific memory walking for kexec_add_buffer

2016-08-19 Thread Thiago Jung Bauermann
Allow architectures to specify a different memory walking function for kexec_add_buffer. x86 uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Young Acked-by: Balbir Singh --- include/linux/kexec.h | 29

[PATCH v6 06/12] powerpc: Adapt elf64_apply_relocate_add for kexec_file_load.

2016-08-19 Thread Thiago Jung Bauermann
before relocating the module, while the latter does that adjustment during relocation of the purgatory. Also, add a check_symbols argument so that the kexec code can be stricter about undefined symbols. Finally, add relocation types used by the purgatory. Signed-off-by: Thiago Jung Bauermann

[PATCH v6 04/12] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-19 Thread Thiago Jung Bauermann
alled from elf64_apply_relocate_add. local_entry_offset and squash_toc_save_inst were only used by apply_rellocate_add, so they were moved to elf_util_64.c as well. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 70 arch/powerpc/include/asm/module.h

[PATCH v6 07/12] powerpc: Add functions to read ELF files of any endianness.

2016-08-19 Thread Thiago Jung Bauermann
ating the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 18 ++ arch/powerpc/kernel/Makefile| 2 +- arch/powerpc/kernel/elf_util.c | 476 ++

[PATCH v6 11/12] powerpc: Add purgatory for kexec_file_load implementation.

2016-08-19 Thread Thiago Jung Bauermann
that the purgatory can add those dot symbols. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Makefile | 4 + arch/powerpc/boot/string.S| 67 ++-- arch/powerpc/purgatory/.gitignore | 2 + arch/powerpc/purgatory/Makefile

[PATCH v6 12/12] powerpc: Enable CONFIG_KEXEC_FILE in powerpc server defconfigs.

2016-08-19 Thread Thiago Jung Bauermann
Enable CONFIG_KEXEC_FILE in powernv_defconfig, ppc64_defconfig and pseries_defconfig. It depends on CONFIG_CRYPTO_SHA256=y, so add that as well. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/powernv_defconfig | 2 ++ arch/powerpc/configs/ppc64_defconfig | 2 ++ arch/powerpc

[PATCH v6 09/12] powerpc: Add code to work with device trees in kexec_file_load.

2016-08-19 Thread Thiago Jung Bauermann
kexec_file_load needs to set up the device tree that will be used by the next kernel and check whether it provides a console that can be used by the purgatory. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 3 + arch/powerpc/kernel/machine_kexec_64.c | 220

[PATCH v6 10/12] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-08-19 Thread Thiago Jung Bauermann
Mohan Kumar M (mo...@in.ibm.com) + * Copyright (C) 2016 IBM Corporation + * + * Based on kexec-tools' kexec-elf-exec.c and kexec-elf-ppc64.c. + * Heavily modified for the kernel by + * Thiago Jung Bauermann . + * + * This program is free software; you can redistribute it and/or modify + * it

[PATCH v6 08/12] powerpc: Implement kexec_file_load.

2016-08-19 Thread Thiago Jung Bauermann
arch_kexec_walk_mem and arch_kexec_apply_relocations_add are used by generic kexec code, while setup_purgatory is powerpc-specific and sets runtime variables needed by the powerpc purgatory implementation. Signed-off-by: Josh Sklar Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig

[PATCH v6 05/12] powerpc: Generalize elf64_apply_relocate_add.

2016-08-19 Thread Thiago Jung Bauermann
et at its final location by adding an addr_base argument to specify the address at which the section will be loaded, and rela, loc_base and syms_base to point to the sections' contents. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 6 ++-- arch/powerpc/kernel/

[PATCH v6 03/12] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-08-19 Thread Thiago Jung Bauermann
kexec_locate_mem_hole will be used by the PowerPC kexec_file_load implementation to find free memory for the purgatory stack. Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Young --- include/linux/kexec.h | 1 + kernel/kexec_file.c | 25 - 2 files changed, 21

Re: [PATCH v2 3/6] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-18 Thread Thiago Jung Bauermann
Hello Dave, Thanks for your review! [ Trimming down Cc: list a little to try to clear the "too many recipients" mailing list restriction. ] Am Donnerstag, 18 August 2016, 17:03:30 schrieb Dave Young: > On 08/13/16 at 12:18am, Thiago Jung Bauermann wrote: > > Adds c

Re: [PATCH v2 0/6] kexec_file: Add buffer hand-over for the next kernel

2016-08-16 Thread Thiago Jung Bauermann
Hello Dave, Am Mittwoch, 17 August 2016, 10:52:26 schrieb Dave Young: > On 08/13/16 at 12:18am, Thiago Jung Bauermann wrote: > > This series applies on top of v5 of the "kexec_file_load implementation > > for PowerPC" patch series (which applies on top of

Re: [PATCH v5 02/13] kexec_file: Change kexec_add_buffer to take kexec_buf as argument.

2016-08-16 Thread Thiago Jung Bauermann
Am Dienstag, 16 August 2016, 16:15:55 schrieb Balbir Singh: > On 16/08/16 00:49, Thiago Jung Bauermann wrote: > > Am Montag, 15 August 2016, 17:30:49 schrieb Balbir Singh: > >> On Thu, Aug 11, 2016 at 08:08:07PM -0300, Thiago Jung Bauermann wrote: > >>> Adapt a

Re: [PATCH v2 4/6] kexec_file: Add mechanism to update kexec segments.

2016-08-16 Thread Thiago Jung Bauermann
Hello Andrew, Thank you for your review! Am Montag, 15 August 2016, 15:27:56 schrieb Andrew Morton: > On Sat, 13 Aug 2016 00:18:23 -0300 Thiago Jung Bauermann > wrote: > > +/** > > + * kexec_update_segment - update the contents of a kimage segment > > + * @buffer:

[PATCH v2 2/2] kexec: extend kexec_file_load system call

2016-08-15 Thread Thiago Jung Bauermann
fdset" argument points to the following struct buffer: struct kexec_fdset { int nr_fds; struct kexec_file_fd fds[0]; } Signed-off-by: AKASHI Takahiro Signed-off-by: Thiago Jung Bauermann --- include/linux/fs.h | 1 + include/lin

Re: [PATCH v5 04/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-15 Thread Thiago Jung Bauermann
Am Montag, 15 August 2016, 17:46:34 schrieb Balbir Singh: > On Thu, Aug 11, 2016 at 08:08:09PM -0300, Thiago Jung Bauermann wrote: > > +/** > > + * elf64_apply_relocate_add - apply 64 bit RELA relocations > > + * @elf_info: Support information for the ELF bi

Re: [PATCH v5 02/13] kexec_file: Change kexec_add_buffer to take kexec_buf as argument.

2016-08-15 Thread Thiago Jung Bauermann
Am Montag, 15 August 2016, 17:30:49 schrieb Balbir Singh: > On Thu, Aug 11, 2016 at 08:08:07PM -0300, Thiago Jung Bauermann wrote: > > Adapt all callers to the new function prototype. > > Could you please expand on this? Is the following better? Adapt all callers to set up a ke

[PATCH v2 5/6] kexec: Share logic to copy segment page contents.

2016-08-12 Thread Thiago Jung Bauermann
Make kimage_load_normal_segment and kexec_update_segment share code which they currently duplicate. Signed-off-by: Thiago Jung Bauermann --- kernel/kexec_core.c | 159 +++- 1 file changed, 95 insertions(+), 64 deletions(-) diff --git a/kernel

[PATCH v2 6/6] IMA: Demonstration code for kexec buffer passing.

2016-08-12 Thread Thiago Jung Bauermann
This patch is not intended to be committed. It shows how kernel code can use the kexec buffer passing mechanism to pass information to the next kernel. Signed-off-by: Thiago Jung Bauermann --- include/linux/ima.h | 11 + kernel/kexec_file.c | 4

[PATCH v2 4/6] kexec_file: Add mechanism to update kexec segments.

2016-08-12 Thread Thiago Jung Bauermann
kexec_update_segment allows a given segment in kexec_image to have its contents updated. This is useful if the current kernel wants to send information to the next kernel that is up-to-date at the time of reboot. Signed-off-by: Thiago Jung Bauermann --- include/linux/kexec.h | 2 ++ kernel

[PATCH v2 1/6] kexec_file: Add buffer hand-over support for the next kernel

2016-08-12 Thread Thiago Jung Bauermann
hiago Jung Bauermann --- include/linux/kexec.h | 29 ++ kernel/kexec_file.c | 68 +++ 2 files changed, 97 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index ceccc5856aab..4559a1a01b0a 100644 --- a/in

[PATCH v2 2/6] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-12 Thread Thiago Jung Bauermann
The buffer hand-over mechanism allows the currently running kernel to pass data to kernel that will be kexec'd via a kexec segment. The second kernel can check whether the previous kernel sent data and retrieve it. This is the architecture-specific part. Signed-off-by: Thiago Jung Baue

[PATCH v2 3/6] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-12 Thread Thiago Jung Bauermann
purgatory checksum verification to fail when the machine is rebooted. As a bonus, we don't need to special-case the purgatory segment anymore to avoid checksumming it. Adjust call sites for the new argument. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/kexec_elf_64.c

[PATCH v2 0/6] kexec_file: Add buffer hand-over for the next kernel

2016-08-12 Thread Thiago Jung Bauermann
oved unnecessary "#include " in kexec_file.c. - Round up memsz argument to PAGE_SIZE. - Check if kexec_image is NULL in kexec_update_segment. - Patch "IMA: Demonstration code for kexec buffer passing." - Avoid registering reboot notifier again if kexec_file_load is called

Re: [PATCH v2 2/2] kexec: extend kexec_file_load system call

2016-08-12 Thread Thiago Jung Bauermann
Hello Balbir, Thank you for the review! Am Freitag, 12 August 2016, 18:17:39 schrieb Balbir Singh: > On Thu, Aug 11, 2016 at 08:03:58PM -0300, Thiago Jung Bauermann wrote: > > diff --git a/include/linux/fs.h b/include/linux/fs.h > > index 3523bf62f328..847d9c31f428 100644 > >

Re: [PATCH v5 11/13] powerpc: Allow userspace to set device tree properties in kexec_file_load

2016-08-11 Thread Thiago Jung Bauermann
Hello Sam, Thanks for the quick response. Am Freitag, 12 August 2016, 10:45:00 schrieb Samuel Mendoza-Jonas: > On Thu, 2016-08-11 at 20:08 -0300, Thiago Jung Bauermann wrote: > > @@ -908,4 +909,245 @@ bool find_debug_console(const void *fdt, int > > chosen_nod

[PATCH v5 01/13] kexec_file: Allow arch-specific memory walking for kexec_add_buffer

2016-08-11 Thread Thiago Jung Bauermann
Allow architectures to specify a different memory walking function for kexec_add_buffer. x86 uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Young --- include/linux/kexec.h | 26

[PATCH v5 06/13] powerpc: Adapt elf64_apply_relocate_add for kexec_file_load.

2016-08-11 Thread Thiago Jung Bauermann
before relocating the module, while the latter does that adjustment during relocation of the purgatory. Also, add a check_symbols argument so that the kexec code can be stricter about undefined symbols. Finally, add relocation types used by the purgatory. Signed-off-by: Thiago Jung Bauermann

[PATCH v5 04/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-11 Thread Thiago Jung Bauermann
alled from elf64_apply_relocate_add. local_entry_offset and squash_toc_save_inst were only used by apply_rellocate_add, so they were moved to elf_util_64.c as well. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 70 arch/powerpc/include/asm/module.h

[PATCH v5 03/13] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-08-11 Thread Thiago Jung Bauermann
kexec_locate_mem_hole will be used by the PowerPC kexec_file_load implementation to find free memory for the purgatory stack. Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Young --- include/linux/kexec.h | 1 + kernel/kexec_file.c | 25 - 2 files changed, 21

[PATCH v5 08/13] powerpc: Implement kexec_file_load.

2016-08-11 Thread Thiago Jung Bauermann
arch_kexec_walk_mem and arch_kexec_apply_relocations_add are used by generic kexec code, while setup_purgatory is powerpc-specific and sets runtime variables needed by the powerpc purgatory implementation. Signed-off-by: Josh Sklar Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig

[PATCH v5 05/13] powerpc: Generalize elf64_apply_relocate_add.

2016-08-11 Thread Thiago Jung Bauermann
et at its final location by adding an addr_base argument to specify the address at which the section will be loaded, and rela, loc_base and syms_base to point to the sections' contents. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 6 ++-- arch/powerpc/kernel/

[PATCH v5 09/13] powerpc: Add code to work with device trees in kexec_file_load.

2016-08-11 Thread Thiago Jung Bauermann
kexec_file_load needs to set up the device tree that will be used by the next kernel and check whether it provides a console that can be used by the purgatory. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 3 + arch/powerpc/kernel/machine_kexec_64.c | 222

[PATCH v5 02/13] kexec_file: Change kexec_add_buffer to take kexec_buf as argument.

2016-08-11 Thread Thiago Jung Bauermann
Adapt all callers to the new function prototype. In addition, change the type of kexec_buf.buffer from char * to void *. There is no particular reason for it to be a char *, and the change allows us to get rid of 3 existing casts to char * in the code. Signed-off-by: Thiago Jung Bauermann Acked

[PATCH v5 13/13] powerpc: Enable CONFIG_KEXEC_FILE in powerpc server defconfigs.

2016-08-11 Thread Thiago Jung Bauermann
Enable CONFIG_KEXEC_FILE in powernv_defconfig, ppc64_defconfig and pseries_defconfig. It depends on CONFIG_CRYPTO_SHA256=y, so add that as well. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/powernv_defconfig | 2 ++ arch/powerpc/configs/ppc64_defconfig | 2 ++ arch/powerpc

[PATCH v5 11/13] powerpc: Allow userspace to set device tree properties in kexec_file_load

2016-08-11 Thread Thiago Jung Bauermann
Ellerman Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 1 + arch/powerpc/kernel/kexec_elf_64.c | 9 ++ arch/powerpc/kernel/machine_kexec_64.c | 242 + 3 files changed, 252 insertions(+) diff --git a/arch/powerpc/include

[PATCH v5 10/13] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-08-11 Thread Thiago Jung Bauermann
Mohan Kumar M (mo...@in.ibm.com) + * Copyright (C) 2016 IBM Corporation + * + * Based on kexec-tools' kexec-elf-exec.c and kexec-elf-ppc64.c. + * Heavily modified for the kernel by + * Thiago Jung Bauermann . + * + * This program is free software; you can redistribute it and/or modify + * it

[PATCH v5 12/13] powerpc: Add purgatory for kexec_file_load implementation.

2016-08-11 Thread Thiago Jung Bauermann
A-256 implementation. Also, some formatting warnings found by checkpatch.pl were fixed. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Makefile | 4 + arch/powerpc/purgatory/.gitignore | 2 + arch/powerpc/purgatory/Makefile | 36 +++ arch/powerpc/purg

[PATCH v5 00/13] kexec_file_load implementation for PowerPC

2016-08-11 Thread Thiago Jung Bauermann
;kexec_file: Generalize kexec_add_buffer.": broke in two, one adding arch_kexec_walk_mem and the other adding kexec_locate_mem_hole. - Patch "powerpc: Implement kexec_file_load.": - Moved relocation changes and the arch_kexec_walk_mem implementation to the next patch in the

[PATCH v5 07/13] powerpc: Add functions to read ELF files of any endianness.

2016-08-11 Thread Thiago Jung Bauermann
ating the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf_util.h | 19 ++ arch/powerpc/kernel/Makefile| 2 +- arch/powerpc/kernel/elf_util.c | 476 ++

[PATCH v2 1/2] kexec: add dtb info to struct kimage

2016-08-11 Thread Thiago Jung Bauermann
From: AKASHI Takahiro Device tree blob must be passed to a second kernel on DTB-capable archs, like powerpc and arm64, but the current kernel interface lacks this support. This patch adds dtb buffer information to struct kimage. When users don't specify dtb explicitly and the one used for the cu

[PATCH v2 0/2] extend kexec_file_load system call

2016-08-11 Thread Thiago Jung Bauermann
uot;binary compatibility." [1] http://lists.infradead.org/pipermail/kexec/2016-June/016276.html AKASHI Takahiro (1): kexec: add dtb info to struct kimage Thiago Jung Bauermann (1): kexec: extend kexec_file_load system call include/linux/fs.h | 1 + include/linux/kexec.h |

[PATCH v2 2/2] kexec: extend kexec_file_load system call

2016-08-11 Thread Thiago Jung Bauermann
ct kexec_file_fd fds[0]; } Signed-off-by: AKASHI Takahiro Signed-off-by: Thiago Jung Bauermann --- include/linux/fs.h | 1 + include/linux/kexec.h | 7 ++-- include/linux/syscalls.h | 4 ++- include/uapi/linux/kexec.h | 22 kernel/kexe

Re: [PATCH 1/7] ima: on soft reboot, restore the measurement list

2016-08-10 Thread Thiago Jung Bauermann
Am Mittwoch, 10 August 2016, 13:41:08 schrieb Michael Ellerman: > Thiago Jung Bauermann writes: > > Am Dienstag, 09 August 2016, 09:01:13 schrieb Mimi Zohar: > >> On Tue, 2016-08-09 at 20:59 +1000, Michael Ellerman wrote: > >> > Mimi Zohar writes: > >> &g

Re: [PATCH 1/7] ima: on soft reboot, restore the measurement list

2016-08-09 Thread Thiago Jung Bauermann
ked; > > > + > > > > Am I understanding it correctly that this structure is passed between > > kernels? > Yes, the header prefixes the measurement list, which is being passed on > the same computer to the next kernel. Could the architecture (eg. > LE/BE) change

Re: [PATCH v2 3/3] kexec: extend kexec_file_load system call

2016-08-05 Thread Thiago Jung Bauermann
Hi, Am Dienstag, 26 Juli 2016, 21:24:29 schrieb Thiago Jung Bauermann: > Notes: > This is a new version of the last patch in this series which adds > a function where each architecture can verify if the DTB is safe > to load: > > int __weak arch_kexec_

Re: [PATCH v4 0/9] kexec_file_load implementation for PowerPC

2016-08-01 Thread Thiago Jung Bauermann
Hello, Am Donnerstag, 07 Juli 2016, 13:23:26 schrieb Thiago Jung Bauermann: > Note: We are currently discussing whether we need a new syscall so that > userspace can provide a custom device tree for the new kernel. Even if > that ends up being the way forward, it would affect only patche

[PATCH v2 3/3] kexec: extend kexec_file_load system call

2016-07-26 Thread Thiago Jung Bauermann
]; } Signed-off-by: AKASHI Takahiro Signed-off-by: Thiago Jung Bauermann --- Notes: This is a new version of the last patch in this series which adds a function where each architecture can verify if the DTB is safe to load: int __weak arch_kexec_verify_buffer(enum

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-22 Thread Thiago Jung Bauermann
Am Freitag, 22 Juli 2016, 12:54:28 schrieb Michael Ellerman: > Thiago Jung Bauermann writes: > > So even if not ideal, the solution above is desirable for powerpc. We > > would like to preserve the ability of allowing userspace to pass > > parameters to the OS via the DTB, e

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-21 Thread Thiago Jung Bauermann
Am Freitag, 15 Juli 2016, 18:03:35 schrieb Thiago Jung Bauermann: > Am Freitag, 15 Juli 2016, 22:26:09 schrieb Arnd Bergmann: > > However, the powerpc specific RTAS runtime services provide a similar > > interface to the UEFI runtime support and allow to call into > > binary

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-20 Thread Thiago Jung Bauermann
"plugged" virtually by a managing system (BMC) is considered a physical attack or a remote attack in the context of UEFI Secure Boot. -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-15 Thread Thiago Jung Bauermann
patible properties in /chosen to avoid the problem Mark mentioned. Still doable, but not ideal. :-/ -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-15 Thread Thiago Jung Bauermann
Am Freitag, 15 Juli 2016, 14:33:47 schrieb Mark Rutland: > On Fri, Jul 15, 2016 at 09:26:10AM -0400, Vivek Goyal wrote: > > On Fri, Jul 15, 2016 at 09:31:02AM +0200, Arnd Bergmann wrote: > > > On Thursday, July 14, 2016 10:44:14 PM CEST Thiago Jung Bauermann wrote: > > &g

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-14 Thread Thiago Jung Bauermann
Am Donnerstag, 14 Juli 2016, 10:29:11 schrieb Arnd Bergmann: > On Wednesday, July 13, 2016 11:18:04 PM CEST Thiago Jung Bauermann wrote: > > Am Mittwoch, 13 Juli 2016, 21:59:18 schrieb Arnd Bergmann: > > > On Wednesday, July 13, 2016 3:45:41 PM CEST Thiago Jung Bauermann

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-13 Thread Thiago Jung Bauermann
Am Mittwoch, 13 Juli 2016, 21:59:18 schrieb Arnd Bergmann: > On Wednesday, July 13, 2016 3:45:41 PM CEST Thiago Jung Bauermann wrote: > > Am Mittwoch, 13 Juli 2016, 15:13:42 schrieb Arnd Bergmann: > > > On Wednesday, July 13, 2016 10:41:28 AM CEST Mark Rutland wrote: > >

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-13 Thread Thiago Jung Bauermann
act with it, as Stewart mentioned in another email. 2. Set display properties on /pciex@n/.../vga@0 in machines with an OpenFirmware framebuffer. -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-12 Thread Thiago Jung Bauermann
for this. > > Until a persuasive case can be made for going around the kernel and > probably adding a feature (like code execution) that can be used to > defeat the signature scheme I am going to nack this. I also don't understand what you mean by code execution. How does passing a device tree blob via kexec enables code execution? How can the signature scheme be defeated? -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-12 Thread Thiago Jung Bauermann
. It has to modify the device tree that will be used by the next kernel so that the next kernel uses the same console that petitboot was configured to use (i.e., set the /chosen/linux,stdout-path property). It also modifies the device tree to allow the kernel to inherit Petitboot's Openfirmware framebuffer. -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC] arm64: kexec_file_load support

2016-07-08 Thread Thiago Jung Bauermann
ish whether the process passed 5 or 6 arguments? How can it know whether extra_fds is a valid argument or just garbage? I think we have to define a new flag KEXEC_FILE_EXTRA_FDS so that the process can signal that it is using the new interface. -- []'s Thiago Jung Bauermann IBM Linux Technology Center

[PATCH v4 9/9] powerpc: Add purgatory for kexec_file_load implementation.

2016-07-07 Thread Thiago Jung Bauermann
A-256 implementation. Also, some formatting warnings found by checkpatch.pl were fixed. Signed-off-by: Thiago Jung Bauermann Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/Makefile | 4 + arch/powerpc/purgatory/.gitignore | 2 + arch/po

[PATCH v4 2/9] kexec_file: Change kexec_add_buffer to take kexec_buf as argument.

2016-07-07 Thread Thiago Jung Bauermann
Adapt all callers to the new function prototype. In addition, change the type of kexec_buf.buffer from char * to void *. There is no particular reason for it to be a char *, and the change allows us to get rid of 3 existing casts to char * in the code. Signed-off-by: Thiago Jung Bauermann Cc

[PATCH v4 6/9] powerpc: Add functions to read ELF files of any endianness.

2016-07-07 Thread Thiago Jung Bauermann
ating the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/include/asm/elf_util.h | 19 ++ arch/powerpc/kernel/Makefile| 2 +- arch/po

[PATCH v4 1/9] kexec_file: Allow arch-specific memory walking for kexec_add_buffer

2016-07-07 Thread Thiago Jung Bauermann
Allow architectures to specify a different memory walking function for kexec_add_buffer. x86 uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann Cc: Eric Biederman Cc: Dave Young --- include/linux/kexec.h | 29

[PATCH v4 7/9] powerpc: Implement kexec_file_load.

2016-07-07 Thread Thiago Jung Bauermann
Adds the basic machinery needed by kexec_file_load. Signed-off-by: Josh Sklar Signed-off-by: Thiago Jung Bauermann Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/Kconfig | 13 + arch/powerpc/include/asm/systbl.h | 1

<    1   2   3   4   5   6   7   >