Re: [PATCH v19 10/13] arm64: kdump: add VMCOREINFO's for user-space coredump tools

2016-06-21 Thread AKASHI Takahiro
On Mon, Jun 20, 2016 at 11:02:22AM +0530, Pratyush Anand wrote: > +Atsushi > > Hi Takahiro, > > On 16/06/2016:11:48:28 PM, Geoff Levand wrote: > > From: AKASHI Takahiro > > > > For the current crash utility, we need to know, at least, > > - kimage_voffset > > - PHYS_OFFSET > > to handle the

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

2016-06-21 Thread Dave Young
On 06/20/16 at 10:44pm, Thiago Jung Bauermann wrote: > Hello, > > This patch series implements a mechanism which allows the kernel to pass on > a buffer to the kernel that will be kexec'd. This buffer is passed as a > segment which is added to the kimage when it is being prepared by > kexec_file_l

RE: [PATCH v2] makedumpfile: support _count -> _refcount rename in struct page

2016-06-21 Thread Atsushi Kumagai
>Pratyush Anand writes: > >> On 21/06/2016:10:05:42 AM, Vitaly Kuznetsov wrote: >>> Pratyush Anand writes: >>> >>> > On 21/06/2016:05:43:29 AM, Atsushi Kumagai wrote: >>> >> Hello Vitaly, >>> >> >>> >> >_count member was renamed to _refcount in linux commit 0139aa7b7fa12 >>> >> >("mm: rename _cou

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Russell King - ARM Linux
On Tue, Jun 21, 2016 at 09:55:25AM -0700, Tony Lindgren wrote: > * Russell King - ARM Linux [160621 08:46]: > > On Tue, Jun 21, 2016 at 03:57:20AM -0700, Tony Lindgren wrote: > > > > > > Maybe zImage size + MAX_RODATA_SZ + 4x zImage size? > > > > > > Then the MAX_RODATA_SZ could be 2 or 4 MB or

[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
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 v3 9/9] powerpc: Add purgatory for kexec_file_load implementation.

2016-06-21 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 implementati

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

2016-06-21 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 v3 8/9] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-06-21 Thread Thiago Jung Bauermann
This uses all the infrastructure built up by the previous patches in the series to load an ELF vmlinux file and an initrd. It uses the flattened device tree at initial_boot_params as a base and adjusts memory reservations and its /chosen node for the next kernel. elf64_apply_relocate_add was exten

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

2016-06-21 Thread Thiago Jung Bauermann
A little endian kernel might need to kexec a big endian kernel (the opposite is less likely but could happen as well), so we can't just cast the buffer with the binary to ELF structs and use them as is done elsewhere. This patch adds functions which do byte-swapping as necessary when populating th

[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 Cc: Eric Biederman Cc: kexec@lists.infradead.org Cc: linux-ker...@vger.kernel.org Acked-by:

[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 Cc: Eric Biederman Cc: Dave Young Cc: kexec@lists.infradead.org Cc: linux-ker..

[PATCH v3 0/9] kexec_file_load implementation for PowerPC

2016-06-21 Thread Thiago Jung Bauermann
Hello, This patch series implements the kexec_file_load system call on PowerPC. This system call moves the reading of the kernel, initrd and the device tree from the userspace kexec tool to the kernel. This is needed if you want to do one or both of the following: 1. only allow loading of signed

[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 Signed-off-by: Thiago Jung Bauermann Cc: kexec@lists.infradead.org Cc: linux-ker...@vger.kernel.org --- arch/powerpc/Kconfig | 13 + arch/powerpc/include/asm/systbl.h | 1 + arch/powerp

[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 Cc: Eric Biederman Cc: Dave Young Cc: kexec@lists.infradead.org Cc: linux-ker...@vger.kernel.org --- include/linux/kexec.h | 4 +++

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Tony Lindgren
* Russell King - ARM Linux [160621 08:46]: > On Tue, Jun 21, 2016 at 03:57:20AM -0700, Tony Lindgren wrote: > > > > Maybe zImage size + MAX_RODATA_SZ + 4x zImage size? > > > > Then the MAX_RODATA_SZ could be 2 or 4 MB or whatever we > > think is sufficient to kick the can until we have a better

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Russell King - ARM Linux
On Tue, Jun 21, 2016 at 03:57:20AM -0700, Tony Lindgren wrote: > * Tony Lindgren [160621 03:41]: > > * Russell King - ARM Linux [160621 02:50]: > > > > > > There isn't really an answer which will always work for this problem, > > > as I've already detailed in a previous thread discussing the iss

Re: kexec failures with DEBUG_RODATA

2016-06-21 Thread Russell King - ARM Linux
On Tue, Jun 21, 2016 at 05:18:49PM +0530, Pratyush Anand wrote: > On 16/06/2016:12:13:03 AM, Russell King - ARM Linux wrote: > > I should point out that this method should work for a zImage without > > an appended DTB, and we have no way to update this header block for > > the appended DTB case. >

Re: kexec failures with DEBUG_RODATA

2016-06-21 Thread Pratyush Anand
Hi Russell, On 16/06/2016:12:13:03 AM, Russell King - ARM Linux wrote: > On Wed, Jun 15, 2016 at 03:54:38PM -0700, Kees Cook wrote: > > On Wed, Jun 15, 2016 at 3:42 PM, Russell King - ARM Linux > > wrote: > > > In fact, the apparent confusion over this reinforces my belief that we > > > should _n

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Tony Lindgren
* Tony Lindgren [160621 03:41]: > * Russell King - ARM Linux [160621 02:50]: > > > > There isn't really an answer which will always work for this problem, > > as I've already detailed in a previous thread discussing the issue. > > Adding a zImage header don't fix the problem. > > Well how about

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Tony Lindgren
* Russell King - ARM Linux [160621 02:50]: > On Tue, Jun 21, 2016 at 12:43:21AM -0700, Tony Lindgren wrote: > > Hi, > > > > * Russell King [160617 12:52]: > > > If we want to assume that the compressed image will expand by a maximum > > > of 4x, we actually need to reserve 5x the space, since we

Re: [PATCH v2] makedumpfile: support _count -> _refcount rename in struct page

2016-06-21 Thread Vitaly Kuznetsov
Pratyush Anand writes: > On 21/06/2016:10:05:42 AM, Vitaly Kuznetsov wrote: >> Pratyush Anand writes: >> >> > On 21/06/2016:05:43:29 AM, Atsushi Kumagai wrote: >> >> Hello Vitaly, >> >> >> >> >_count member was renamed to _refcount in linux commit 0139aa7b7fa12 >> >> >("mm: rename _count, fiel

Re: [PATCH v2] makedumpfile: support _count -> _refcount rename in struct page

2016-06-21 Thread Pratyush Anand
On 21/06/2016:10:05:42 AM, Vitaly Kuznetsov wrote: > Pratyush Anand writes: > > > On 21/06/2016:05:43:29 AM, Atsushi Kumagai wrote: > >> Hello Vitaly, > >> > >> >_count member was renamed to _refcount in linux commit 0139aa7b7fa12 > >> >("mm: rename _count, field of the struct page, to _refcount

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Russell King - ARM Linux
On Tue, Jun 21, 2016 at 12:43:21AM -0700, Tony Lindgren wrote: > Hi, > > * Russell King [160617 12:52]: > > If we want to assume that the compressed image will expand by a maximum > > of 4x, we actually need to reserve 5x the space, since we need to keep > > a copy of the compessed image around w

Re: [PATCH 0/2] Simple fix to the ARM kexec tools implementation

2016-06-21 Thread Russell King - ARM Linux
On Tue, Jun 21, 2016 at 11:41:28AM +0530, Pratyush Anand wrote: > Yes, so until we have proper header for zImage, these patches looks > fine to me. If you read my last email in the "kexec failures with DEBUG_RODATA" thread, you'll see that I'm unhappy with this idea, because adding a "proper heade

Re: [PATCH v2] makedumpfile: support _count -> _refcount rename in struct page

2016-06-21 Thread Vitaly Kuznetsov
Pratyush Anand writes: > On 21/06/2016:05:43:29 AM, Atsushi Kumagai wrote: >> Hello Vitaly, >> >> >_count member was renamed to _refcount in linux commit 0139aa7b7fa12 >> >("mm: rename _count, field of the struct page, to _refcount") and this >> >broke makedumpfile. The reason for making the cha

Re: [PATCH 2/2] arm: fix kernel image size

2016-06-21 Thread Tony Lindgren
Hi, * Russell King [160617 12:52]: > If we want to assume that the compressed image will expand by a maximum > of 4x, we actually need to reserve 5x the space, since we need to keep > a copy of the compessed image around while decompressing. Looks like 5x is not enough with omap2plus_defconfig a