Skip to content

Add kexec_file_load support to s390

Philipp Rudo kexec lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17kexec_file: Silence compile warningsinclude/linux/kexec.h+2 -00 replies
2/17kexec_file: Remove checks in kexec_purgatory_loadkernel/kexec_file.c+0 -140 replies
3/17kexec_file: Make purgatory_info->ehdr constinclude/linux/kexec.h kernel/kexec_file.c+13 -80 replies
4/17kexec_file: Search symbols in read-only kexec_purgatorykernel/kexec_file.c+22 -160 replies
5/17kexec_file: Use read-only sections in arch_kexec_apply_relocations*arch/x86/kernel/machine_kexec_64.c include/linux/kexec.h kernel/kexec_file.c+70 -610 replies
6/17kexec_file: Split up __kexec_load_puragorykernel/kexec_file.c+103 -970 replies
7/17kexec_file: Simplify kexec_purgatory_setup_sechdrs 1kernel/kexec_file.c+30 -460 replies
8/17kexec_file: Simplify kexec_purgatory_setup_sechdrs 2kernel/kexec_file.c+12 -220 replies
9/17kexec_file: Remove mis-use of sh_offset fieldarch/x86/kernel/machine_kexec_64.c kernel/kexec_file.c+9 -340 replies
10/17kexec_file: Allow archs to set purgatory load addressarch/powerpc/kernel/kexec_elf_64.c arch/x86/kernel/kexec-bzimage64.c include/linux/kexec.h +1 more+26 -270 replies
11/17kexec_file: Move purgatories sha256 to common codearch/x86/purgatory/Makefile arch/x86/purgatory/purgatory.c include/linux/sha256.h +1 more+15 -40 replies
12/17s390/kexec_file: Prepare setup.h for kexec_file_loadarch/s390/include/asm/setup.h+27 -130 replies
13/17s390/kexec_file: Add purgatoryarch/s390/Kbuild arch/s390/include/asm/purgatory.h arch/s390/kernel/asm-offsets.c +3 more+194 -00 replies
14/17s390/kexec_file: Add kexec_file_load system callarch/s390/Kconfig arch/s390/kernel/Makefile arch/s390/kernel/compat_wrapper.c +2 more+181 -00 replies
15/17s390/kexec_file: Add image loaderarch/s390/include/asm/kexec.h arch/s390/kernel/Makefile arch/s390/kernel/kexec_image.c +1 more+176 -10 replies
16/17s390/kexec_file: Add crash support to image loaderarch/s390/kernel/kexec_image.c arch/s390/kernel/machine_kexec_file.c arch/s390/purgatory/head.S +1 more+234 -60 replies
17/17s390/kexec_file: Add ELF loaderarch/s390/include/asm/kexec.h arch/s390/kernel/Makefile arch/s390/kernel/kexec_elf.c +1 more+152 -10 replies

Reviews trailers per patch

4 of 17 patches have a Reviewed-by or Acked-by.

PatchMartin Schwidefsky
1/17
2/17
3/17
4/17
5/17
6/17
7/17R-b
8/17
9/17
10/17R-b
11/17
12/17
13/17
14/17
15/17R-b
16/17R-b
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/17] Add kexec_file_load support to s390

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. Especially remove the mis-use of the purgatory_info->sechdrs->sh_offset field, currently holding a pointer into either kexec_purgatory (ro) or purgatory_buf (rw) depending on the section. With these patches the section address will be calculated verbosely and sh_offset will contain the offset of the section in the stripped purgatory binary (purgatory_buf).

Patch #10: Allows architectures to set the purgaory load address. This patch is important for s390 as the kernel and purgatory have to be loaded to fixed addresses. In current code this is impossible as the purgatory load is opaque to the architecture.

Patch #11: Moves x86 purgatories sha implementation to common lib/ directory.

Patches #12-17 finally adds the kexec_file_load system call to s390.

Please note that I had to touch arch code for x86 and power a little. In theory this should not change the behavior but I don't have a way to test it. Cross-compiling with defconfig(*) works fine for both.

Thanks
Philipp

(*) On x86 with the orc unwinder turned off. objtool SEGFAULTs on s390...

Philipp Rudo (17):
kexec_file: Silence compile warnings
kexec_file: Remove checks in kexec_purgatory_load
kexec_file: Make purgatory_info->ehdr const
kexec_file: Search symbols in read-only kexec_purgatory
kexec_file: Use read-only sections in arch_kexec_apply_relocations*
kexec_file: Split up __kexec_load_puragory
kexec_file: Simplify kexec_purgatory_setup_sechdrs 1
kexec_file: Simplify kexec_purgatory_setup_sechdrs 2
kexec_file: Remove mis-use of sh_offset field
kexec_file: Allow archs to set purgatory load address
kexec_file: Move purgatories sha256 to common code s390/kexec_file: Prepare setup.h for kexec_file_load s390/kexec_file: Add purgatory
s390/kexec_file: Add kexec_file_load system call s390/kexec_file: Add image loader
s390/kexec_file: Add crash support to image loader s390/kexec_file: Add ELF loader

 arch/powerpc/kernel/kexec_elf_64.c             |   9 +-
 arch/s390/Kbuild                               |   1 +
 arch/s390/Kconfig                              |   4 +
 arch/s390/include/asm/kexec.h                  |  23 ++
 arch/s390/include/asm/purgatory.h              |  17 ++
 arch/s390/include/asm/setup.h                  |  40 ++-
 arch/s390/kernel/Makefile                      |   1 +
 arch/s390/kernel/asm-offsets.c                 |   5 +
 arch/s390/kernel/compat_wrapper.c              |   1 +
 arch/s390/kernel/kexec_elf.c                   | 149 ++++++++++
 arch/s390/kernel/kexec_image.c                 |  78 +++++
 arch/s390/kernel/machine_kexec_file.c          | 291 +++++++++++++++++++
 arch/s390/kernel/syscalls/syscall.tbl          |   1 +
 arch/s390/purgatory/Makefile                   |  37 +++
 arch/s390/purgatory/head.S                     | 279 ++++++++++++++++++
 arch/s390/purgatory/purgatory.c                |  42 +++
 arch/x86/kernel/kexec-bzimage64.c              |   8 +-
 arch/x86/kernel/machine_kexec_64.c             |  66 ++---
 arch/x86/purgatory/Makefile                    |   3 +
 arch/x86/purgatory/purgatory.c                 |   2 +-
 include/linux/kexec.h                          |  38 +--
 {arch/x86/purgatory => include/linux}/sha256.h |  10 +-
 kernel/kexec_file.c                            | 375 ++++++++++++-------------
 {arch/x86/purgatory => lib}/sha256.c           |   4 +-
 24 files changed, 1200 insertions(+), 284 deletions(-)
 create mode 100644 arch/s390/include/asm/purgatory.h
 create mode 100644 arch/s390/kernel/kexec_elf.c
 create mode 100644 arch/s390/kernel/kexec_image.c
 create mode 100644 arch/s390/kernel/machine_kexec_file.c
 create mode 100644 arch/s390/purgatory/Makefile
 create mode 100644 arch/s390/purgatory/head.S
 create mode 100644 arch/s390/purgatory/purgatory.c
 rename {arch/x86/purgatory => include/linux}/sha256.h (63%)
 rename {arch/x86/purgatory => lib}/sha256.c (99%)
Signature · 1 line
2.13.5