linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] kexec_file_load implementation for PowerPC
@ 2016-06-12  3:10 Thiago Jung Bauermann
  2016-06-12  3:10 ` [PATCH 1/8] kexec_file: Remove unused members from struct kexec_buf Thiago Jung Bauermann
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Thiago Jung Bauermann @ 2016-06-12  3:10 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: kexec, linux-kernel, Thiago Jung Bauermann

Hello,

This patch series implements the kexec_file_load system call on PowerPC.

It starts by removing an x86 assumption from kexec_file: kexec_add_buffer uses
iomem to find reserved memory ranges, but PowerPC uses the memblock subsystem.
Hooks are added so that each arch can specify how memory ranges can be found.

Also, the memory-walking logic in kexec_add_buffer is useful in this
implementation to find a free area for the purgatory's stack, so that same
patch moves that logic to kexec_locate_mem_hole.

The kexec_file_load system call needs to apply relocations to the purgatory
but adding code for that would duplicate functionality with the module loading
mechanism, which also needs to apply relocations to the kernel modules.
Therefore, this patch series factors out the module relocation code so that it
can be shared.

One thing that is still missing is crashkernel support, which I intend to
submit shortly.

This code is based on kexec-tools, but with many modifications to adapt it to
the kernel environment and facilities. Except the purgatory, which only has
minimal changes.

Thiago Jung Bauermann (8):
  kexec_file: Remove unused members from struct kexec_buf.
  kexec_file: Generalize kexec_add_buffer.
  powerpc: Factor out relocation code from module_64.c to elf_util_64.c.
  powerpc: Generalize elf64_apply_relocate_add.
  powerpc: Add functions to read ELF files of any endianness.
  powerpc: Implement kexec_file_load.
  powerpc: Add support for loading ELF kernels with kexec_file_load.
  powerpc: Add purgatory for kexec_file_load implementation.

 arch/powerpc/Kconfig                      |  13 +
 arch/powerpc/Makefile                     |   4 +
 arch/powerpc/include/asm/elf_util.h       |  92 +++++
 arch/powerpc/include/asm/kexec_elf_64.h   |  10 +
 arch/powerpc/include/asm/module.h         |  14 +-
 arch/powerpc/include/asm/systbl.h         |   1 +
 arch/powerpc/include/asm/unistd.h         |   2 +-
 arch/powerpc/include/uapi/asm/unistd.h    |   1 +
 arch/powerpc/kernel/Makefile              |   7 +
 arch/powerpc/kernel/elf_util.c            | 476 +++++++++++++++++++++++++
 arch/powerpc/kernel/elf_util_64.c         | 373 ++++++++++++++++++++
 arch/powerpc/kernel/kexec_elf_64.c        | 564 ++++++++++++++++++++++++++++++
 arch/powerpc/kernel/machine_kexec_64.c    | 142 ++++++++
 arch/powerpc/kernel/module_64.c           | 328 +++--------------
 arch/powerpc/purgatory/.gitignore         |   2 +
 arch/powerpc/purgatory/Makefile           |  36 ++
 arch/powerpc/purgatory/console-ppc64.c    |  43 +++
 arch/powerpc/purgatory/crashdump-ppc64.h  |  42 +++
 arch/powerpc/purgatory/crashdump_backup.c |  40 +++
 arch/powerpc/purgatory/crtsavres.S        |   5 +
 arch/powerpc/purgatory/hvCall.S           |  27 ++
 arch/powerpc/purgatory/hvCall.h           |   8 +
 arch/powerpc/purgatory/kexec-sha256.h     |  11 +
 arch/powerpc/purgatory/ppc64_asm.h        |  18 +
 arch/powerpc/purgatory/printf.c           | 171 +++++++++
 arch/powerpc/purgatory/purgatory-ppc64.c  |  46 +++
 arch/powerpc/purgatory/purgatory-ppc64.h  |   6 +
 arch/powerpc/purgatory/purgatory.c        |  66 ++++
 arch/powerpc/purgatory/purgatory.h        |  11 +
 arch/powerpc/purgatory/sha256.c           |   6 +
 arch/powerpc/purgatory/sha256.h           |   1 +
 arch/powerpc/purgatory/string.S           |   1 +
 arch/powerpc/purgatory/v2wrap.S           | 139 ++++++++
 include/linux/kexec.h                     |  10 +
 kernel/kexec_file.c                       | 102 ++++--
 kernel/kexec_internal.h                   |   2 -
 36 files changed, 2504 insertions(+), 316 deletions(-)
 create mode 100644 arch/powerpc/include/asm/elf_util.h
 create mode 100644 arch/powerpc/include/asm/kexec_elf_64.h
 create mode 100644 arch/powerpc/kernel/elf_util.c
 create mode 100644 arch/powerpc/kernel/elf_util_64.c
 create mode 100644 arch/powerpc/kernel/kexec_elf_64.c
 create mode 100644 arch/powerpc/purgatory/.gitignore
 create mode 100644 arch/powerpc/purgatory/Makefile
 create mode 100644 arch/powerpc/purgatory/console-ppc64.c
 create mode 100644 arch/powerpc/purgatory/crashdump-ppc64.h
 create mode 100644 arch/powerpc/purgatory/crashdump_backup.c
 create mode 100644 arch/powerpc/purgatory/crtsavres.S
 create mode 100644 arch/powerpc/purgatory/hvCall.S
 create mode 100644 arch/powerpc/purgatory/hvCall.h
 create mode 100644 arch/powerpc/purgatory/kexec-sha256.h
 create mode 100644 arch/powerpc/purgatory/ppc64_asm.h
 create mode 100644 arch/powerpc/purgatory/printf.c
 create mode 100644 arch/powerpc/purgatory/purgatory-ppc64.c
 create mode 100644 arch/powerpc/purgatory/purgatory-ppc64.h
 create mode 100644 arch/powerpc/purgatory/purgatory.c
 create mode 100644 arch/powerpc/purgatory/purgatory.h
 create mode 100644 arch/powerpc/purgatory/sha256.c
 create mode 100644 arch/powerpc/purgatory/sha256.h
 create mode 100644 arch/powerpc/purgatory/string.S
 create mode 100644 arch/powerpc/purgatory/v2wrap.S

-- 
1.9.1

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-06-14  1:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12  3:10 [PATCH 0/8] kexec_file_load implementation for PowerPC Thiago Jung Bauermann
2016-06-12  3:10 ` [PATCH 1/8] kexec_file: Remove unused members from struct kexec_buf Thiago Jung Bauermann
2016-06-13  7:05   ` Dave Young
2016-06-12  3:10 ` [PATCH 2/8] kexec_file: Generalize kexec_add_buffer Thiago Jung Bauermann
2016-06-13  7:12   ` Dave Young
2016-06-13  7:29   ` Dave Young
2016-06-13 19:08     ` Thiago Jung Bauermann
2016-06-13 20:40       ` Thiago Jung Bauermann
2016-06-14  1:22       ` Dave Young
2016-06-12  3:10 ` [PATCH 3/8] powerpc: Factor out relocation code from module_64.c to elf_util_64.c Thiago Jung Bauermann
2016-06-12  3:10 ` [PATCH 4/8] powerpc: Generalize elf64_apply_relocate_add Thiago Jung Bauermann
2016-06-12  3:10 ` [PATCH 5/8] powerpc: Add functions to read ELF files of any endianness Thiago Jung Bauermann
2016-06-12  3:10 ` [PATCH 6/8] powerpc: Implement kexec_file_load Thiago Jung Bauermann
2016-06-12  3:10 ` [PATCH 7/8] powerpc: Add support for loading ELF kernels with kexec_file_load Thiago Jung Bauermann
2016-06-12  3:10 ` [PATCH 8/8] powerpc: Add purgatory for kexec_file_load implementation Thiago Jung Bauermann
2016-06-13  7:02 ` [PATCH 0/8] kexec_file_load implementation for PowerPC Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).