Re: [PATCH] arm64: Set -fno-PIC along with -mcmodel=large

2018-02-02 Thread Geoff Levand
Hi, On 01/07/2018 08:26 AM, David Michael wrote: > As seen in GCC's gcc/config/aarch64/aarch64.c, -fPIC with large > code model is unsupported. This fixes the "sorry, unimplemented" > errors when building with compilers defaulting to -fPIC. > --- > > purgatory/arch/arm64/entry.S:1:0: sorry,

Re: [PATCH] kexec: Allow to skip digest calculation for speed

2018-02-02 Thread Jan H. Schönherr
On 02/02/2018 02:42 AM, Eric W. Biederman wrote: > Jan H. Schönherr writes: > >> Give the administrator the ability to trade kexec safety for kexec speed >> by disabling the digest calculation/verification for regular kexecs. >> >> The behavior of kexec-on-crash is not

Re: [PATCH] arm64: fix an issue with kaslr-enabled vmlinux

2018-02-02 Thread Goel, Sameer
I tested this fix and it works well. I am wondering which kexec tool release will pick this fix? On 8/24/2017 1:32 AM, AKASHI Takahiro wrote: > Normally vmlinux for arm64 is of ET_EXEC type, while if built with > CONFIG_RANDAMIZE_BASE (that is KASLR), it will be of ET_DYN type. > Meanwhile,

[PATCH 15/17] s390/kexec_file: Add image loader

2018-02-02 Thread Philipp Rudo
Add an image loader for kexec_file_load. For simplicity first skip crash support. The functions defined in machine_kexec_file will later be shared with the ELF loader. Signed-off-by: Philipp Rudo Reviewed-by: Martin Schwidefsky ---

[PATCH 08/17] kexec_file: Simplify kexec_purgatory_setup_sechdrs 2

2018-02-02 Thread Philipp Rudo
The main loop currently uses quite a lot of variables to update the section headers. Some of them are unnecessary. So clean them up a little. Signed-off-by: Philipp Rudo --- kernel/kexec_file.c | 34 -- 1 file changed, 12 insertions(+),

[PATCH 01/17] kexec_file: Silence compile warnings

2018-02-02 Thread Philipp Rudo
When building the kernel with CONFIG_KEXEC_FILE enabled gcc prints a compile warning multiple times. In file included from /linux/init/initramfs.c:526:0: /include/linux/kexec.h:120:9: warning: ‘struct kimage’ declared inside parameter list [enabled by default] unsigned long

[PATCH 17/17] s390/kexec_file: Add ELF loader

2018-02-02 Thread Philipp Rudo
Add an ELF loader for kexec_file. The main task here is to do proper sanity checks on the ELF file. Basically all other functionality was already implemented for the image loader. Signed-off-by: Philipp Rudo --- arch/s390/include/asm/kexec.h | 1 +

[PATCH 14/17] s390/kexec_file: Add kexec_file_load system call

2018-02-02 Thread Philipp Rudo
This patch adds the kexec_file_load system call to s390 as well as the arch specific functions common code requires to work. Loaders for the different file types will be added later. Signed-off-by: Philipp Rudo --- arch/s390/Kconfig | 4 +

[PATCH 03/17] kexec_file: Make purgatory_info->ehdr const

2018-02-02 Thread Philipp Rudo
The kexec_purgatory buffer is read-only. Thus all pointers into kexec_purgatory are read-only, too. Point this out by explicitly marking purgatory_info->ehdr as 'const' and update the comments in purgatory_info. Signed-off-by: Philipp Rudo --- include/linux/kexec.h |

[PATCH 12/17] s390/kexec_file: Prepare setup.h for kexec_file_load

2018-02-02 Thread Philipp Rudo
kexec_file_load needs to prepare the new kernels before they are loaded. For that it has to know the offsets in head.S, e.g. to register the new command line. Unfortunately there are no macros right now defining those offsets. Define them now. Signed-off-by: Philipp Rudo

[PATCH 13/17] s390/kexec_file: Add purgatory

2018-02-02 Thread Philipp Rudo
The common code expects the architecture to have a purgatory that runs between the two kernels. Add it now. For simplicity first skip crash support. Signed-off-by: Philipp Rudo --- arch/s390/Kbuild | 1 + arch/s390/include/asm/purgatory.h | 17 +++

[PATCH 16/17] s390/kexec_file: Add crash support to image loader

2018-02-02 Thread Philipp Rudo
Add support to load a crash kernel to the image loader. This requires extending the purgatory. Signed-off-by: Philipp Rudo Reviewed-by: Martin Schwidefsky --- arch/s390/kernel/kexec_image.c| 6 +- arch/s390/kernel/machine_kexec_file.c

[PATCH 11/17] kexec_file: Move purgatories sha256 to common code

2018-02-02 Thread Philipp Rudo
The code to verify the new kernels sha digest are applicable for all architectures. Move it to common code. Signed-off-by: Philipp Rudo --- arch/x86/purgatory/Makefile| 3 +++ arch/x86/purgatory/purgatory.c | 2 +-

[PATCH 00/17] Add kexec_file_load support to s390

2018-02-02 Thread Philipp Rudo
Hi everybody this series adds the kexec_file_load system call to s390. Before the system call is added there are some preparations/clean ups to common kexec_file_load. In detail this series contains: Patch #1&2: Minor cleanups/fixes. Patch #3-9: Clean up the purgatory load/relocation code.

[PATCH 09/17] kexec_file: Remove mis-use of sh_offset field

2018-02-02 Thread Philipp Rudo
The current code uses the sh_offset field in purgatory_info->sechdrs to store a pointer to the current load address of the section. Depending whether the section will be loaded or not this is either a pointer into purgatory_info->purgatory_buf or kexec_purgatory. This is not only a violation of

[PATCH 06/17] kexec_file: Split up __kexec_load_puragory

2018-02-02 Thread Philipp Rudo
When inspecting __kexec_load_purgatory you find that it has two tasks 1) setting up the kexec_buffer for the new kernel and, 2) setting up pi->sechdrs for the final load address. The two tasks are independent of each other. To improve readability split up __kexec_load_purgatory

[PATCH 02/17] kexec_file: Remove checks in kexec_purgatory_load

2018-02-02 Thread Philipp Rudo
Before the purgatory is loaded several checks are done whether the ELF file in kexec_purgatory is valid or not. These checks are incomplete. For example they don't check for the total size of the sections defined in the section header table or if the entry point actually points into the purgatory.

[PATCH 07/17] kexec_file: Simplify kexec_purgatory_setup_sechdrs 1

2018-02-02 Thread Philipp Rudo
To update the entry point there is an extra loop over all section headers although this can be done in the main loop. So move it there and eliminate the extra loop and variable to store the 'entry section index'. Also, in the main loop, move the usual case, i.e. non-bss section, out of the extra

[PATCH 05/17] kexec_file: Use read-only sections in arch_kexec_apply_relocations*

2018-02-02 Thread Philipp Rudo
When the relocations are applied to the purgatory only the section the relocations are applied to is writable. The other sections, i.e. the symtab and .rel/.rela, are in read-only kexec_purgatory. Highlight this by marking the corresponding variables as 'const'. While at it also change the

[PATCH 04/17] kexec_file: Search symbols in read-only kexec_purgatory

2018-02-02 Thread Philipp Rudo
The stripped purgatory does not contain a symtab. So when looking for symbols this is done in read-only kexec_purgatory. Highlight this by marking the corresponding variables as 'const'. Signed-off-by: Philipp Rudo --- kernel/kexec_file.c | 38

[PATCH 10/17] kexec_file: Allow archs to set purgatory load address

2018-02-02 Thread Philipp Rudo
For s390 new kernels are loaded to fixed addresses in memory before they are booted. With the current code this is a problem as it assumes the kernel will be loaded to an 'arbitrary' address. In particular, kexec_locate_mem_hole searches for a large enough memory region and sets the load address

[makedumpfile PATCH] Always use bigger SECTION_MAP_MASK

2018-02-02 Thread Petr Tesarik
It is not necessary to distinguish between different kernel versions. Kernel commit 2d070eab2e82 merely reuses a previously unused bit (see clarification in kernel commit def9b71ee651a). The bit was always zero even before that commit, so it is safe to mask it off even for kernel versions before