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
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:
When Stephen Rothwell added this patch series to the linux-next tree,
he found out that it fails to cross build a ppc64 LE kernel using a
ppc64 BE host. This version of the series fixes that problem with a
change in arch/powerpc/purgatory/Makefile.
While I was at it I noticed that it is not necess
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
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
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
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
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
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
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
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 ++
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
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
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
Do not use zero to denote an invalid file descriptor.
First, zero is a valid value, although quite unlikely to be used for
anything except standard input.
Second, open(2) returns a negative value on failure, so there are
already checks for a negative value in some places.
The purpose of this pat
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_
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
In preparation for serializing the binary_runtime_measurements, this patch
maintains the amount of memory required.
Changelog v3:
- include the ima_kexec_hdr size in the binary_runtime_measurement size.
Signed-off-by: Mimi Zohar
---
security/integrity/ima/Kconfig | 12 +
security/in
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 v3:
- Request a kexec segment for storing the measurement list a half page,
not a full page, more than needed for additional measure
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-
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
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
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
On 05/09/16 13:42, Manish Jaggi wrote:
>
>
> On 09/05/2016 01:45 PM, AKASHI Takahiro wrote:
>> [Cc: Marc]
>>
>> On Fri, Sep 02, 2016 at 06:23:25PM +0530, Manish Jaggi wrote:
>>>
>>>
>>> On 08/31/2016 11:01 AM, AKASHI Takahiro wrote:
Manish,
Thank you for testing my kdump and report
On 09/06/2016 09:03 PM, Marc Zyngier wrote:
> On 05/09/16 13:42, Manish Jaggi wrote:
>>
>>
>> On 09/05/2016 01:45 PM, AKASHI Takahiro wrote:
>>> [Cc: Marc]
>>>
>>> On Fri, Sep 02, 2016 at 06:23:25PM +0530, Manish Jaggi wrote:
On 08/31/2016 11:01 AM, AKASHI Takahiro wrote:
> Man
On 06/09/16 17:15, Manish Jaggi wrote:
>
>>> In my setup the GICD_CTRL[RWP] bit is not cleared in the
>>> crashkernels' distributor init function.
>>
>> Which instance is failing? The initial one (just after the initial
>> disable)? Or the one called from gic_dist_config()?
>>
> In crash kernel, w
Thiago Jung Bauermann writes:
2> 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 shoul
v26-specific note: After a comment from Rob[0], an idea of adding
"linux,usable-memory-range" was dropped. Instead, an existing
"reserved-memory" node will be used to limit usable memory ranges
on crash dump kernel.
This works not only on UEFI/ACPI systems but also on DT-only sy
Primary kernel calls machine_crash_shutdown() to shut down non-boot cpus
and save registers' status in per-cpu ELF notes before starting crash
dump kernel. See kernel_kexec().
Even if not all secondary cpus have shut down, we do kdump anyway.
As we don't have to make non-boot(crashed) cpus offline
On the startup of primary kernel, the memory region used by crash dump
kernel must be specified by "crashkernel=" kernel parameter.
reserve_crashkernel() will allocate and reserve the region for later use.
User space tools, like kexec-tools, will be able to find that region as
- "Crash ker
For the current crash utility, we need to know, at least,
- kimage_voffset
- PHYS_OFFSET
to handle the contents of core dump file (/proc/vmcore) correctly due to
the introduction of KASLR (CONFIG_RANDOMIZE_BASE) in v4.6.
This patch puts them as VMCOREINFO's into the file.
- VA_BITS
is also a
On crash dump kernel, all the information about primary kernel's system
memory (core image) is available in elf core header.
The primary kernel will set aside this header with reserve_elfcorehdr()
at boot time and inform crash dump kernel of its location via a new
device-tree property, "linux,elfco
Signed-off-by: AKASHI Takahiro
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index eadf485..e181132 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -77,6 +77,7 @@ CON
This patch adds arch specific descriptions about kdump usage on arm64
to kdump.txt.
Signed-off-by: AKASHI Takahiro
Reviewed-by: Baoquan He
Acked-by: Dave Young
---
Documentation/kdump/kdump.txt | 16 +++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/Documentation/k
From: James Morse
Add documentation for
linux,crashkernel-base and crashkernel-size,
linux,elfcorehdr
used by arm64 kexec/kdump to decribe the kdump reserved area, and
the elfcorehdr's location within it.
Signed-off-by: James Morse
[takahiro.aka...@linaro.org: added "linux,crash
Due to the kernel patch[1], the current code will not be able to identify
the correct value of PHYS_OFFSET if some "reserved" memory region, which
is likely to be UEFI runtime services code/data, exists at an address below
the first "System RAM" regions.
This patch fixes this issue.
Signed-off-by
My kernel patches of kdump suport on arm64 are currently under reviews.
This patchset is synced with them (v26 [1]) and provides necessary changes
for kexec-tools. It should be applied on top of Geoff's kexec-tools patches
v5[2] along with a bugfix[3].
[1]
http://lists.infradead.org/pipermail/li
We make sure that all the other segments, initrd and device-tree blob,
also be loaded into the reserved memory of crash dump kernel.
Signed-off-by: AKASHI Takahiro
---
kexec/arch/arm64/kexec-arm64.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kexec/arch/arm64/kexec-ar
From: Pratyush Anand
This patch adds support to use binary image ie arch/arm64/boot/Image with
kdump.
Signed-off-by: Pratyush Anand
[takahiro.aka...@linaro.org: a bit reworked]
Signed-off-by: AKASHI Takahiro
---
kexec/arch/arm64/kexec-image-arm64.c | 12
1 file changed, 12 insert
We pass the following properties to crash dump kernel:
/chosen/linux,elfcorehdr: elf core header segment,
same as "elfcorehdr=" as on other archs
/reserved-memory/crash_dump@xx: any memory regions to be dumped
into /proc/vmcore
Then,
Elf core header contains the information necessary for the coredump of
the 1st kernel, including its physcal memory layout as well as cpu register
states at the panic.
The segment is allocated inside the reserved memory of crash dump kernel.
Signed-off-by: AKASHI Takahiro
---
kexec/arch/arm64/cr
The following regions need to be identified for later use:
a) memory regions which belong to the 1st kernel
b) usable memory reserved for crash dump kernel
We go through /proc/iomem to find out a) and b) which are marked
as "System RAM" and "Crash kernel", respectively.
Signed-off-by: AKASHI Ta
From: Pratyush Anand
get_kernel_stext_sym() has been defined for both arm and i386. Other
architecture might need some other kernel symbol address. Therefore rewrite
this function as generic function to get any kernel symbol address.
More over, kallsyms is not arch specific representation, there
On Wed, Sep 07, 2016 at 01:29:02PM +0900, AKASHI Takahiro wrote:
> v26-specific note: After a comment from Rob[0], an idea of adding
> "linux,usable-memory-range" was dropped. Instead, an existing
> "reserved-memory" node will be used to limit usable memory ranges
> on crash dump ke
On arm64, we can use the same kernel image as 1st kernel, but
we have to modify the entry point as well as segments' addresses
in the kernel's elf header in order to load them into correct places.
Signed-off-by: AKASHI Takahiro
---
kexec/arch/arm64/crashdump-arm64.c | 23 +++
On Mon, Aug 29, 2016 at 06:11:37PM +0800, Baoquan He wrote:
> Hi Thomas,
>
> I used below code and it works. Since using VMCOREINFO_NUMBER can reuse
> the existing struct number_table to import the data. It makes change
> easier. But the place could be next to KERNEL_IMAGE_SIZE, or as your
> patch
On 09/07/16 at 03:09pm, AKASHI Takahiro wrote:
> On Mon, Aug 29, 2016 at 06:11:37PM +0800, Baoquan He wrote:
> > Hi Thomas,
> >
> > I used below code and it works. Since using VMCOREINFO_NUMBER can reuse
> > the existing struct number_table to import the data. It makes change
> > easier. But the p
47 matches
Mail list logo