[PATCH 7/8] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-06-11 Thread Thiago Jung Bauermann
) + * Copyright (C) 2006 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 <bauer...@linux.vnet.ibm.com>. + * + * This program is free so

[PATCH 6/8] powerpc: Implement kexec_file_load.

2016-06-11 Thread Thiago Jung Bauermann
Adds the machinery needed by kexec_file_load, except actually loading a kernel and initrd. elf64_apply_relocate_add was extended to support relative symbols. This is necessary because before relocation, the module loading mechanism adjusts Elf64_Sym.st_value to point to the absolute memory

[PATCH 3/8] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-06-11 Thread Thiago Jung Bauermann
The kexec_file_load system call needs to relocate the purgatory, so factor out the module relocation code so that it can be shared. This patch's purpose is to move the ELF relocation logic from apply_relocate_add to elf_util_64.c with as few changes as possible. The following changes were needed:

[PATCH 2/8] kexec_file: Generalize kexec_add_buffer.

2016-06-11 Thread Thiago Jung Bauermann
Allow architectures to specify different memory walking functions for kexec_add_buffer. Intel uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Also, factor kexec_locate_mem_hole out of kexec_add_buffer. It will be used by the PowerPC kexec_file_load

[PATCH 4/8] powerpc: Generalize elf64_apply_relocate_add.

2016-06-11 Thread Thiago Jung Bauermann
When apply_relocate_add is called, modules are already loaded at their final location in memory so Elf64_Shdr.sh_addr can be used for accessing the section contents as well as the base address for relocations. This is not the case for kexec's purgatory, because it will only be copied to its final

[PATCH 0/8] kexec_file_load implementation for PowerPC

2016-06-11 Thread Thiago Jung Bauermann
intend to submit shortly. This code is based on kexec-tools, but with many modifications to adapt it to the kernel environment and facilities. Except the purgatory, which only has minimal changes. Thiago Jung Bauermann (8): kexec_file: Remove unused members from struct kexec_buf. kexec_file

[PATCH 5/8] powerpc: Add functions to read ELF files of any endianness.

2016-06-11 Thread Thiago Jung Bauermann
pc/kernel/elf_util.c @@ -0,0 +1,476 @@ +/* + * Utility functions to work with ELF files. + * + * Copyright (C) 2016, IBM Corporation + * + * Based on kexec-tools' kexec-elf.c. Heavily modified for the + * kernel by Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com>. + * + * This program is free so

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

2016-06-11 Thread Thiago Jung Bauermann
This purgatory implementation comes from kexec-tools, almost unchanged. The only changes were that the sha256_regions global variable was renamed to sha_regions to match what kexec_file_load expects, and to use the sha256.c file from x86's purgatory to avoid adding yet another SHA-256

[PATCH 1/8] kexec_file: Remove unused members from struct kexec_buf.

2016-06-11 Thread Thiago Jung Bauermann
kexec_add_buffer uses kexec_buf.buffer and kexec_buf.bufsz to pass along its own arguments buffer and bufsz, but since they aren't used anywhere else, it's pointless. Cc: Eric Biederman Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- kernel/kexec_file.c

[PATCH v2 1/9] kexec_file: Remove unused members from struct kexec_buf.

2016-06-14 Thread Thiago Jung Bauermann
kexec_add_buffer uses kexec_buf.buffer and kexec_buf.bufsz to pass along its own arguments buffer and bufsz, but since they aren't used anywhere else, it's pointless. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: Eric Biederman <ebied...@xmission.co

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

2016-06-14 Thread Thiago Jung Bauermann
the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/include/asm/elf_util.h | 19 ++ arch/powerpc/kernel/Ma

[PATCH v2 4/9] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-06-14 Thread Thiago Jung Bauermann
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 <bauer...@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Pa

[PATCH v2 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-14 Thread Thiago Jung Bauermann
Allow architectures to specify different memory walking functions for kexec_add_buffer. Intel uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: Eric Biederman <ebied...@xmission.com&

[PATCH v2 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-14 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 <bauer...@linux.vnet.ibm.com> Cc: Eric Biederman <ebied...@xmission.com> Cc: Dave Young <dyo...@red

[PATCH v2 5/9] powerpc: Generalize elf64_apply_relocate_add.

2016-06-14 Thread Thiago Jung Bauermann
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 <bauer...@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org&

[PATCH v2 8/9] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-06-14 Thread Thiago Jung Bauermann
by the purgatory. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/include/asm/elf_util.h | 1 + arch/powerpc/include/asm/kexec_elf_64.h | 10 + arch/powerpc/kernel/Makefile| 5 +-

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

2016-06-14 Thread Thiago Jung Bauermann
Adds the basic machinery needed by kexec_file_load. Signed-off-by: Josh Sklar <sk...@linux.vnet.ibm.com> Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/Kconfig

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

2016-06-14 Thread Thiago Jung Bauermann
implementation. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/Makefile | 4 + arch/powerpc/purgatory/.gitignore | 2 + arch/powerpc/purgatory/Makefile

[PATCH v2 0/9] kexec_file_load implementation for PowerPC

2016-06-14 Thread Thiago Jung Bauermann
d relocation changes and the arch_kexec_walk_mem implementation to the next patch in the series. - Removed pr_fmt from machine_kexec_64.c, since the patch doesn't add any call to pr_debug in that file. - Changed arch_kexec_kernel_image_probe to reject crash kernels. Thiago Jung Bauermann (9): kexec

Re: [PATCH v2 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-15 Thread Thiago Jung Bauermann
d, thus it is not necessary to pass these two in arguments. > > Moving above to arch_kexec_walk_mem will make it cleaner. That's true. What about this version? []'s Thiago Jung Bauermann IBM Linux Technology Center kexec_file: Generalize kexec_add_buffer. Allow architectures to

Re: [PATCH 2/8] kexec_file: Generalize kexec_add_buffer.

2016-06-13 Thread Thiago Jung Bauermann
/12/16 at 12:10am, Thiago Jung Bauermann wrote: > > Allow architectures to specify different memory walking functions for > > kexec_add_buffer. Intel uses iomem to track reserved memory ranges, > > but PowerPC uses the memblock subsystem. > > Can the crashk_res be inserted to

Re: [PATCH 2/8] kexec_file: Generalize kexec_add_buffer.

2016-06-13 Thread Thiago Jung Bauermann
Hi Dave, Am Montag, 13 Juni 2016, 16:08:19 schrieb Thiago Jung Bauermann: > Am Montag, 13 Juni 2016, 15:29:39 schrieb Dave Young: > > On 06/12/16 at 12:10am, Thiago Jung Bauermann wrote: > > > Allow architectures to specify different memory walking functions for > > > k

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

2016-06-22 Thread Thiago Jung Bauermann
Hello Balbir, Am Mittwoch, 22 Juni 2016, 23:29:46 schrieb Balbir Singh: > On Tue, 21 Jun 2016 16:48:32 -0300 > Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> wrote: > > This patch series implements the kexec_file_load system call on > > PowerPC. > > > >

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

2016-06-22 Thread Thiago Jung Bauermann
Hello Dave, Thanks for your considerations on this feature. Am Mittwoch, 22 Juni 2016, 09:20:46 schrieb Dave Young: > On 06/20/16 at 10:44pm, Thiago Jung Bauermann wrote: > > This feature was implemented because the Integrity Measurement > > Architecture subsystem needs

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

2016-06-16 Thread Thiago Jung Bauermann
Am Donnerstag, 16 Juni 2016, 15:48:30 schrieb Michael Ellerman: > On Tue, 2016-06-14 at 11:59 -0300, Thiago Jung Bauermann wrote: > > Hello, > > > > This patch series implements the kexec_file_load system call on PowerPC. > > Can you tell me what this syscall does and

Re: [PATCH v2 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-16 Thread Thiago Jung Bauermann
Am Donnerstag, 16 Juni 2016, 09:58:53 schrieb Dave Young: > On 06/15/16 at 01:21pm, Thiago Jung Bauermann wrote: > > +/** > > + * arch_kexec_walk_mem - call func(data) on free memory regions > > + * @image_type:kimage.type > > + * @top_down: Start from the hig

[PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-21 Thread Thiago Jung Bauermann
Allow architectures to specify different memory walking functions for kexec_add_buffer. Intel uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: Eric Biederman <ebied...@xmission.com&

[PATCH v3 4/9] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-06-21 Thread Thiago Jung Bauermann
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 <bauer...@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Pa

[PATCH v3 5/9] powerpc: Generalize elf64_apply_relocate_add.

2016-06-21 Thread Thiago Jung Bauermann
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 <bauer...@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org&

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

2016-06-21 Thread Thiago Jung Bauermann
Adds the basic machinery needed by kexec_file_load. Signed-off-by: Josh Sklar <sk...@linux.vnet.ibm.com> Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/Kconfig

[PATCH v3 8/9] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-06-21 Thread Thiago Jung Bauermann
by the purgatory. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/include/asm/elf_util.h | 1 + arch/powerpc/include/asm/kexec_elf_64.h | 10 + arch/powerpc/kernel/Makefile| 5 +-

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

2016-06-21 Thread Thiago Jung Bauermann
the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/include/asm/elf_util.h | 19 ++ arch/powerpc/kernel/Ma

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

2016-06-21 Thread Thiago Jung Bauermann
implementation. Also, some formatting warnings found by checkpatch.pl were fixed. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: ke...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/Makefile | 4 + arch/powerpc/purgatory/.git

[PATCH v3 0/9] kexec_file_load implementation for PowerPC

2016-06-21 Thread Thiago Jung Bauermann
ec_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 from machine_kexec_64.c, since the patch doesn't add any call to pr_debug in that

[PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-21 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 <bauer...@linux.vnet.ibm.com> Cc: Eric Biederman <ebied...@xmission.com> Cc: Dave Young <dyo...@red

[PATCH v3 1/9] kexec_file: Remove unused members from struct kexec_buf.

2016-06-21 Thread Thiago Jung Bauermann
kexec_add_buffer uses kexec_buf.buffer and kexec_buf.bufsz to pass along its own arguments buffer and bufsz, but since they aren't used anywhere else, it's pointless. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: Eric Biederman <ebied...@xmission.co

Re: [PATCH v2 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-17 Thread Thiago Jung Bauermann
Am Freitag, 17 Juni 2016, 15:35:23 schrieb Dave Young: > On 06/16/16 at 05:39pm, Thiago Jung Bauermann wrote: > > Am Donnerstag, 16 Juni 2016, 09:58:53 schrieb Dave Young: > > > On 06/15/16 at 01:21pm, Thiago Jung Bauermann wrote: > > > > +int __weak arch_kexec_wa

Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-22 Thread Thiago Jung Bauermann
also changed the description to refer to x86 arch instead of Intel arch. []'s Thiago Jung Bauermann IBM Linux Technology Center Subject: [PATCH 2/9] kexec_file: Allow arch-specific memory walking for kexec_add_buffer Allow architectures to specify a different memory walking function for kexec_add

Re: [PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-22 Thread Thiago Jung Bauermann
Am Mittwoch, 22 Juni 2016, 18:18:01 schrieb Dave Young: > On 06/21/16 at 04:48pm, Thiago Jung Bauermann wrote: > > +/** > > + * kexec_locate_mem_hole - find free memory to load segment or use in > > purgatory + * @image: kexec image being updated. > > + * @size:

Re: [PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-23 Thread Thiago Jung Bauermann
> "static"). > > We also recommend providing kernel-doc formatted documentation > for private (file "static") routines, for consistency of kernel > source code layout. But this is lower priority and at the > discretion of the MAINTAINER of that kernel source file. If

Re: [PATCH v2 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-20 Thread Thiago Jung Bauermann
Am Montag, 20 Juni 2016, 10:26:05 schrieb Dave Young: > kexec_buf should go within #ifdef for kexec file like struct > purgatory_info > > Other than that it looks good. Great! Here it is. -- []'s Thiago Jung Bauermann IBM Linux Technology Center kexec_file: Generalize kexe

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

2016-06-20 Thread Thiago Jung Bauermann
une/016078.html Thiago Jung Bauermann (6): kexec_file: Add buffer hand-over support for the next kernel powerpc: kexec_file: Add buffer hand-over support for the next kernel kexec_file: Allow skipping checksum calculation for some segments. kexec_file: Add mechanism to update kexec segment

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

2016-06-20 Thread Thiago Jung Bauermann
the 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 <bauer...@linux.vnet.ibm.com> --- arch/p

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

2016-06-20 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 <bauer...@linux.vnet.ibm.com> --- kernel/kexec_core.c | 159 +++- 1 file changed, 95 insertions(

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

2016-06-20 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 <bauer...@linux.vnet.ibm.com> --- i

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

2016-06-20 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 <bauer...@linux.vnet.ibm.com> --- include/linux/ima.h | 11 + kernel/kexec_

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

2016-06-20 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 Bauermann

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

2016-06-21 Thread Thiago Jung Bauermann
Jung Bauermann <bauer...@linux.vnet.ibm.com> --- include/linux/kexec.h | 40 ++ kernel/kexec_file.c | 79 +++ 2 files changed, 119 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index a08cd9

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

2016-06-23 Thread Thiago Jung Bauermann
Am Freitag, 24 Juni 2016, 08:33:24 schrieb Balbir Singh: > On 24/06/16 02:44, Thiago Jung Bauermann wrote: > > Sorry, I still don't understand your concern. What kind of cheating? > > Which values? If it's the values in the event log, there's no need to > > trust the old k

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

2016-06-23 Thread Thiago Jung Bauermann
Am Donnerstag, 23 Juni 2016, 09:57:51 schrieb Balbir Singh: > On 23/06/16 03:02, Thiago Jung Bauermann wrote: > >>> 3. have IMA pass-on its event log (where integrity measurements are > >>> > >>>registered) accross kexec to the second kernel, so that

Re: [PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-27 Thread Thiago Jung Bauermann
Am Dienstag, 28 Juni 2016, 00:19:48 schrieb Dave Young: > On 06/23/16 at 12:37pm, Thiago Jung Bauermann wrote: > > Am Donnerstag, 23 Juni 2016, 01:44:07 schrieb Dave Young: > > What is bad about the description of top_down? > It is not clear enough to me, I personally thin

Re: [PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-27 Thread Thiago Jung Bauermann
Am Montag, 27 Juni 2016, 13:37:58 schrieb Thiago Jung Bauermann: > Should I add a separate top_down argument to kexec_locate_mem_hole to > control if the memory walk should be from top to bottom, and then the > bottom_up member of struct kexec_buf controls where inside each memory

Re: [PATCH] ftrace: filter: Match dot symbols when searching functions on ppc64.

2016-04-01 Thread Thiago Jung Bauermann
cc1: all warnings being treated as errors I forgot to use defined() in the #if expression. Here’s the fixed version. -- []'s Thiago Jung Bauermann IBM Linux Technology Center 8< 8< 8< 8< >From 27660a3b6c4147f9e1811b103cc47a34a53817c1 Mon Sep 17 00:00:00 2

[PATCH] ftrace: filter: Match dot symbols when searching functions on ppc64.

2016-03-31 Thread Thiago Jung Bauermann
Cc: Ingo Molnar <mi...@redhat.com> Cc: Michael Ellerman <m...@ellerman.id.au> Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/ftrace.h | 9 + kernel/trace/ftrace.c | 13 + 2 files changed, 22 inser

[PATCH v2] ftrace: Match dot symbols when searching functions on ppc64

2016-04-25 Thread Thiago Jung Bauermann
Cc: Ingo Molnar <mi...@redhat.com> Cc: Michael Ellerman <m...@ellerman.id.au> Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- Notes: Changes from v1 to v2: - Use __weak mechanism instead of #ifdef. - Return modified

Re: [PATCH] ftrace: filter: Match dot symbols when searching functions on ppc64.

2016-04-14 Thread Thiago Jung Bauermann
tr, search); > /* use tmp_str and then ignore */ > kfree(str); If you decide against either of my alternatives for using arch__compare_symbol_names, I'll change arch_ftrace_match_adjust to work as you suggested above in the next version of this patch. > ** Disclaimer ** > > Note, I just took the red-eye (2 hours of sleep on the plane) and > waiting for my next flight. My focus may be off in this email. Ouch. Thanks for having a look at the patch and responding to my ping! -- []'s Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] ftrace: filter: Match dot symbols when searching functions on ppc64.

2016-04-13 Thread Thiago Jung Bauermann
Hello, Am Freitag, 01 April 2016, 18:28:06 schrieb Thiago Jung Bauermann: > Am Samstag, 02 April 2016, 03:51:21 schrieb kbuild test robot: > > >> arch/powerpc/include/asm/ftrace.h:62:5: error: "CONFIG_PPC64" is not > > >> defined [-Werror=undef] > >

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

2016-07-26 Thread Thiago Jung Bauermann
]; } Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- 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 i

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-22 Thread Thiago Jung Bauermann
Am Freitag, 22 Juli 2016, 12:54:28 schrieb Michael Ellerman: > Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> 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 > &g

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

[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

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

2016-08-11 Thread Thiago Jung Bauermann
int nr_fds; struct kexec_file_fd fds[0]; } Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- include/linux/fs.h | 1 + include/linux/kexec.h | 7 ++-- include/lin

[PATCH v2 0/2] extend kexec_file_load system call

2016-08-11 Thread Thiago Jung Bauermann
atibility." [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 | 10 -- incl

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 07/13] powerpc: Add functions to read ELF files of any endianness.

2016-08-11 Thread Thiago Jung Bauermann
the ELF structs. These functions will be used in the next patch in the series. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/elf_util.h | 19 ++ arch/powerpc/kernel/Makefile| 2 +- arch/powerpc/kernel/elf_util.c

[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
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 <bauer...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/elf_util.h | 70 arch/p

[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 <bauer...@linux.vnet.ibm.com> Acked-by: Dave Young <dyo...@r

[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

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 <bauer...@linux.vnet.ibm.com> writes: > > Am Dienstag, 09 August 2016, 09:01:13 schrieb Mimi Zohar: > >> On Tue, 2016-08-09 at 20:59 +1000, Michael Ellerman wrote: > >> >

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 > >

[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 Bauermann

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

2016-08-12 Thread Thiago Jung Bauermann
the 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 <bauer...@linux.vnet.ibm.com> --- arch/p

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

2016-08-12 Thread Thiago Jung Bauermann
y "#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 more than once

[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 <bauer...@linux.vnet.ibm.com> --- kernel/kexec_core.c | 159 +++- 1 file changed, 95 insertions(

[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 <bauer...@linux.vnet.ibm.com> --- include/linux/ima.h | 11 + kernel/kexec_

[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 <bauer...@linux.vnet.ibm.com> --- i

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

2016-08-12 Thread Thiago Jung Bauermann
Jung Bauermann <bauer...@linux.vnet.ibm.com> --- 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 ceccc5

[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 <bauer...@linux.vnet.ibm.com> Acked-by: Dave Young <dyo...@redhat.com> --- include/linux/kexec.h | 1 + kernel/kexec_f

[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 <sk...@linux.vnet.ibm.com> Signed-off-by: Thiago Jung Bau

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

2016-08-11 Thread Thiago Jung Bauermann
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 <bauer...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/elf_util.h | 6 ++-- arch/p

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

2016-08-11 Thread Thiago Jung Bauermann
Ellerman <m...@ellerman.id.au> Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- 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

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

2016-08-11 Thread Thiago Jung Bauermann
(shar...@in.ibm.com) + * Copyright (C) 2006 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 <bauer...@linux.vnet.ibm.com>. + * + * This pro

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

2016-08-11 Thread Thiago Jung Bauermann
implementation. Also, some formatting warnings found by checkpatch.pl were fixed. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> --- arch/powerpc/Makefile | 4 + arch/powerpc/purgatory/.gitignore | 2 + arch/powerpc/purgatory/Makefile

[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 <bauer...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/kexec.h | 3 + arch/p

[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 <ba

[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 <bauer...@linux.vnet.ibm.com> --- arch/powerpc/configs/powernv_defconfig | 2 ++ arch/powerpc/c

[PATCH v5 00/13] kexec_file_load implementation for PowerPC

2016-08-11 Thread Thiago Jung Bauermann
ralize 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 series. - Removed pr

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

2016-07-13 Thread Thiago Jung Bauermann
ith 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-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-20 Thread Thiago Jung Bauermann
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
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-15 Thread Thiago Jung Bauermann
hosen 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-12 Thread Thiago Jung Bauermann
s kexec to load the target OS. 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 0/3] extend kexec_file_load system call

2016-07-12 Thread Thiago Jung Bauermann
h userspace 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 p

Re: [PATCH v3 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-06-28 Thread Thiago Jung Bauermann
Am Dienstag, 28 Juni 2016, 15:20:55 schrieb Dave Young: > On 06/27/16 at 04:21pm, Dave Young wrote: > > Please ignore previous reply, I mistakenly send a broken mail without > > subject, sorry about it. Resend the reply here. > > > > On 06/27/16 at 01:37pm, Thiago Jun

Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer.

2016-06-28 Thread Thiago Jung Bauermann
Am Donnerstag, 23 Juni 2016, 10:25:06 schrieb Dave Young: > On 06/22/16 at 08:30pm, Thiago Jung Bauermann wrote: > > Am Mittwoch, 22 Juni 2016, 18:20:47 schrieb Dave Young: > > > The patch looks good, but could the subject be more specific? > > > > > > For

Re: [RFC] arm64: kexec_file_load support

2016-07-04 Thread Thiago Jung Bauermann
Hello, Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro: > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > I agree that it would be better if we could have a system call where a > > > custom device tree could be passed. One suggestion is:

[PATCH v4 8/9] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-07-07 Thread Thiago Jung Bauermann
by the purgatory. Signed-off-by: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Paul Mackerras <pau...@samba.org> Cc: Michael Ellerman <m...@ellerman.id.au> --- arch/powerpc/include/asm/elf_util.h | 1 +

[PATCH v4 5/9] powerpc: Generalize elf64_apply_relocate_add.

2016-07-07 Thread Thiago Jung Bauermann
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 <bauer...@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org&

  1   2   3   4   5   6   7   8   9   10   >