Re: [PATCH v24 0/9] arm64: add kdump support

2016-08-30 Thread AKASHI Takahiro
Manish, Thank you for testing my kdump and reporting issues. On Wed, Aug 31, 2016 at 09:11:52AM +0530, Manish Jaggi wrote: > Hi Akashi, > > On 08/09/2016 07:22 AM, AKASHI Takahiro wrote: > > This patch series adds kdump support on arm64. > > > > To load a crash-dump kernel to the systems, a ser

Re: [PATCH v24 9/9] Documentation: dt: chosen properties for arm64 kdump

2016-08-30 Thread AKASHI Takahiro
On Wed, Aug 31, 2016 at 08:45:46AM +0900, AKASHI Takahiro wrote: > Rob, > > On Tue, Aug 30, 2016 at 11:34:10AM -0500, Rob Herring wrote: > > On Sun, Aug 21, 2016 at 11:28 PM, AKASHI Takahiro > > wrote: > > > Rob, > > > [Cc: Mark] > > > > > > On Fri, Aug 19, 2016 at 08:26:41AM -0500, Rob Herring w

Re: [PATCH v24 0/9] arm64: add kdump support

2016-08-30 Thread Manish Jaggi
Hi Akashi, On 08/09/2016 07:22 AM, AKASHI Takahiro wrote: > This patch series adds kdump support on arm64. > > To load a crash-dump kernel to the systems, a series of patches to > kexec-tools, which have not yet been merged upstream, are needed. > Please use my kdump patches [1]. > > To examine

Re: [PATCH v24 9/9] Documentation: dt: chosen properties for arm64 kdump

2016-08-30 Thread AKASHI Takahiro
Rob, On Tue, Aug 30, 2016 at 11:34:10AM -0500, Rob Herring wrote: > On Sun, Aug 21, 2016 at 11:28 PM, AKASHI Takahiro > wrote: > > Rob, > > [Cc: Mark] > > > > On Fri, Aug 19, 2016 at 08:26:41AM -0500, Rob Herring wrote: > >> On Tue, Aug 09, 2016 at 10:57:47AM +0900, AKASHI Takahiro wrote: > >> >

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

2016-08-30 Thread Thiago Jung Bauermann
Hello Dave, Sorry for the delay, I was trying to get the other patch series ready as I mentioned in the other email. Am Donnerstag, 18 August 2016, 16:19:46 schrieb Dave Young: > Since Eric was objecting the extension, I think you should convince him, > but I will review from code point of view.

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

2016-08-30 Thread Thiago Jung Bauermann
Hello Mark, Sorry for taking this long to respond. I've been focusing on getting my kexec_file_load and kexec buffer hand-over series in shape. Am Donnerstag, 18 August 2016, 11:21:13 schrieb Mark Rutland: > On Thu, Aug 11, 2016 at 08:03:56PM -0300, Thiago Jung Bauermann wrote: > > Device tree b

[PATHC v2 9/9] ima: platform-independent hash value

2016-08-30 Thread Mimi Zohar
From: Andreas Steffen For remote attestion it is important for the ima measurement values to be platform-independent. Therefore integer fields to be hashed must be converted to canonical format. Changelog: - Define canonical format as little endian (Mimi) Signed-off-by: Andreas Steffen Signed-

[PATHC v2 4/9] ima: serialize the binary_runtime_measurements

2016-08-30 Thread Mimi Zohar
The TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement list of the running kernel must be saved and restored on boot. This patch serializes the IMA measurement list in the binary_runtime_measurements format. Signed

[PATHC v2 3/9] ima: maintain memory size needed for serializing the measurement list

2016-08-30 Thread Mimi Zohar
In preparation for serializing the binary_runtime_measurements, this patch maintains the amount of memory required. Signed-off-by: Mimi Zohar --- security/integrity/ima/Kconfig | 12 ++ security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_queue.c | 49 +++

[PATHC v2 6/9] ima: store the builtin/custom template definitions in a list

2016-08-30 Thread Mimi Zohar
The builtin and single custom templates are currently stored in an array. In preparation for being able to restore a measurement list containing multiple builtin/custom templates, this patch stores the builtin and custom templates as a linked list. This will permit defining more than one custom t

[PATHC v2 8/9] ima: define a canonical binary_runtime_measurements list format

2016-08-30 Thread Mimi Zohar
The IMA binary_runtime_measurements list is currently in platform native format. To allow restoring a measurement list carried across kexec with a different endianness than the targeted kernel, this patch defines little-endian as the canonical format. For big endian systems wanting to save/restor

[PATHC v2 0/9] ima: carry the measurement list across kexec

2016-08-30 Thread Mimi Zohar
The TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement list of the running kernel must be saved and then restored on the subsequent boot, possibly of a different architecture. The existing securityfs binary_runtime_

[PATHC v2 5/9] ima: on soft reboot, save the measurement list

2016-08-30 Thread Mimi Zohar
From: Thiago Jung Bauermann This patch uses the kexec buffer passing mechanism to pass the serialized IMA binary_runtime_measurements to the next kernel. Changelog v2: - Fix build issue by defining a stub ima_add_kexec_buffer and stub struct kimage when CONFIG_IMA=n and CONFIG_IMA_KEXEC=n. (Fe

[PATHC v2 2/9] ima: permit duplicate measurement list entries

2016-08-30 Thread Mimi Zohar
Measurements carried across kexec need to be added to the IMA measurement list, but should not prevent measurements of the newly booted kernel from being added to the measurement list. This patch adds support for allowing duplicate measurements. The "boot_aggregate" measurement entry is the delimi

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

2016-08-30 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 v7 07/13] powerpc: Adapt elf64_apply_relocate_add for kexec_file_load.

2016-08-30 Thread Thiago Jung Bauermann
Extend elf64_apply_relocate_add to support relative symbols. This is necessary because there is a difference between how the module loading mechanism and the kexec purgatory loading code use Elf64_Sym.st_value at relocation time: the former changes st_value to point to the absolute memory address b

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

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

2016-08-30 Thread Thiago Jung Bauermann
Add skip_checksum member to struct kexec_buf to specify whether the corresponding segment should be part of the checksum calculation. The next patch will add a way to update segments after a kimage is loaded. Segments that will be updated in this way should not be checksummed, otherwise they will

[PATCH v4 1/5] 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-independent part of the feature. Signed-off-by: Thiago Ju

[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/incl

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

2016-08-30 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 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 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/kexe

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

2016-08-30 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 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 ins

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

2016-08-30 Thread Thiago Jung Bauermann
Hello, The purpose of this new version of the series is to fix a small issue that I found, which is that the kernel doesn't remove the memory reservation for the hand-over buffer it received from the previous kernel in the device tree it sets up for the next kernel. The result is that for each suc

[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
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 v7 11/13] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-08-30 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. Signed-off-by: Thiago Jung Bauerma

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

2016-08-30 Thread Thiago Jung Bauermann
Commit 2965faa5e03d ("kexec: split kexec_load syscall from kexec core code") introduced CONFIG_KEXEC_CORE so that CONFIG_KEXEC means whether the kexec_load system call should be compiled-in and CONFIG_KEXEC_FILE means whether the kexec_file_load system call should be compiled-in. These options can

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

2016-08-30 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 v7 00/13] kexec_file_load implementation for PowerPC

2016-08-30 Thread Thiago Jung Bauermann
The purpose of this new version of the series is to allow building with CONFIG_KEXEC=n and CONFIG_KEXEC_FILE=y. This is done by patch 4, which is new in v7. The other patches have very little changes, just to fix checkpatch warnings, as noted in the changelog. Note that at this moment the powerpc

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

2016-08-30 Thread Thiago Jung Bauermann
This is done to simplify the kexec_add_buffer argument list. Adapt all callers to set up a kexec_buf to pass to kexec_add_buffer. 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 ex

[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/co

Re: [PATCH v24 9/9] Documentation: dt: chosen properties for arm64 kdump

2016-08-30 Thread Rob Herring
On Sun, Aug 21, 2016 at 11:28 PM, AKASHI Takahiro wrote: > Rob, > [Cc: Mark] > > On Fri, Aug 19, 2016 at 08:26:41AM -0500, Rob Herring wrote: >> On Tue, Aug 09, 2016 at 10:57:47AM +0900, AKASHI Takahiro wrote: >> > From: James Morse >> > >> > Add documentation for >> > linux,crashkernel-base

"kernel version not supported" message is causing concerns

2016-08-30 Thread Louis Bouchard
Hello, Every so often, I get questions or bug report about the fact that makedumpfile issues the following message when running : The kernel version is not supported. The created dumpfile may be incomplete. While I understand the requirement for this message, it almost systematically is un