--- v3
+++ v5
@@ -1,4 +1,25 @@
-Hello,
+[ Andrew, since this series touches generic code, x86 and powerpc,
+ Michael Ellerman and Dave Young think it should go via your tree. ]
+
+The main differences in this version are (more detailed changelog at
+the end of this email):
+
+- The code which is not specific to loading ELF format kernels were
+ moved from kexec_elf_64.c to machine_kexec_64.c.
+
+- There is a new patch implementing support for receiving a device tree
+ blob from userspace, checking it against a whitelist of allowed nodes
+ and properties and copying it into the device tree for the next kernel.
+ This is the only patch that depends on the "extend kexec_file_load
+ system call" series. Everything else can be upstreamed independently
+ of that series.
+
+- Also, I realised that the patch "Add support for loading ELF kernels
+ with kexec_file_load." was too big, so I moved some changes to other
+ patches to facilitate review. Details of what went where are in the
+ changelog.
+
+Original cover letter:
This patch series implements the kexec_file_load system call on PowerPC.
@@ -44,6 +65,55 @@
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.
+
+Changes for v5:
+- Rebased series on v4.8-rc1 + the extend kexec_file_load series.
+- Patch "powerpc: Adapt elf64_apply_relocate_add for kexec_file_load."
+ - New patch. These changes were previously in patch 10.
+ The code itself is unchanged from v4.
+- Patch "powerpc: Implement kexec_file_load."
+ - Moved arch_kexec_walk_mem, arch_kexec_apply_relocations_add and
+ setup_purgatory from patch 10 to this patch.
+ - arch_kexec_apply_relocations_add is unchanged from v4.
+ - Fixed off-by-one error in arch_kexec_walk_mem when passing range
+ to func.
+ - Moved setup_purgatory from kexec_elf_64.c to machine_kexec_64.c,
+ and changed it to receive a pointer to the slave code directly
+ rather than a struct elf_info and getting the pointer from there.
+- Patch "powerpc: Add code to work with device trees in kexec_file_load."
+ - New patch. These changes were previously in patch 10.
+ - find_debug_console moved from kexec_elf_64.c to machine_kexec_64.c.
+ The code is unchanged from v4.
+ - setup_new_fdt is a new function factored out of elf64_load. The only
+ code change from v4 is to create /chosen if it doesn't exist yet.
+- Patch "powerpc: Add support for loading ELF kernels with kexec_file_load."
+ - This patch was too big, so moved some of its changes to other patches
+ to facilitate review.
+ - Allow loading ELF file type ET_DYN, which is what the BE kernel uses.
+ - The code adapting the device tree for booting the new kernel was moved
+ out of elf64_load to setup_new_fdt.
+- Patch "powerpc: Allow userspace to set device tree properties in kexec_file_load"
+ - New patch.
+ - The code in this patch didn't exist in v4.
+ - This is the only patch that depends on the extend kexec_file_load series.
+- Patch "powerpc: Enable CONFIG_KEXEC_FILE in powerpc server defconfigs."
+ - New patch.
+
+Changes for v4:
+- Rebased series on today's powerpc/next.
+- Patch "kexec_file: Remove unused members from struct kexec_buf.":
+ - Dropped from the series.
+- Patch "kexec_file: Allow arch-specific memory walking function for
+ kexec_add_buffer":
+ - Changed subject line to be more specific. Was: "kexec_file: Generalize
+ kexec_add_buffer.".
+ - Changed description to refer to x86 arch instead of Intel arch.
+ - Moved documentation comments for struct kexec_buf to this patch.
+- Patch "kexec_file: Change kexec_add_buffer to take kexec_buf as argument.":
+ - New patch.
+- Patch "kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.":
+ - Changed kexec_locate_mem_hole to take kexec_buf as argument.
+ - Improved description of kexec_locate_mem_hole in documentation comment.
Changes for v3:
- Rebased series on today's powerpc/next.
@@ -65,7 +135,6 @@
- Changed to use the new PPC64_ELF_ABI_v2 macro.
Changes for v2:
-
- All patches: forgot to add Signed-off-by lines in v1, so added them now.
- Patch "kexec_file: Generalize kexec_add_buffer.": broke in two, one
adding arch_kexec_walk_mem and the other adding kexec_locate_mem_hole.
@@ -76,85 +145,66 @@
any call to pr_debug in that file.
- Changed arch_kexec_kernel_image_probe to reject crash kernels.
-Changes for v3:
-- Rebased series on today's powerpc/next.
-- Patch "kexec_file: Generalize kexec_add_buffer.":
- - Removed most arguments from arch_kexec_walk_mem and pass kbuf
- explicitly.
-- Patch "powerpc: Add functions to read ELF files of any endianness.":
- - Fixed whitespace issues found by checkpatch.pl.
-- Patch "powerpc: Factor out relocation code from module_64.c to
- elf_util_64.c.":
- - Changed to use the new PPC64_ELF_ABI_v2 macro.
-- Patch "powerpc: Add support for loading ELF kernels with
- kexec_file_load.":
- - Adapted arch_kexec_walk_mem implementation to changes in its
- argument list.
- - Fixed whitespace and GPL header issues found by checkpatch.pl.
-- Patch "powerpc: Add purgatory for kexec_file_load implementation.":
- - Fixed whitespace and GPL header issues found by checkpatch.pl.
- - Changed to use the new PPC64_ELF_ABI_v2 macro.
-
-Changes for v2:
-
-- All patches: forgot to add Signed-off-by lines in v1, so added them now.
-- Patch "kexec_file: Generalize kexec_add_buffer.": broke in two, one
- adding arch_kexec_walk_mem and the other adding kexec_locate_mem_hole.
-- Patch "powerpc: Implement kexec_file_load.":
- - Moved relocation changes and the arch_kexec_walk_mem implementation
- to the next patch in the series.
- - Removed pr_fmt from machine_kexec_64.c, since the patch doesn't add
- any call to pr_debug in that file.
- - Changed arch_kexec_kernel_image_probe to reject crash kernels.
-
-Thiago Jung Bauermann (9):
- kexec_file: Remove unused members from struct kexec_buf.
- kexec_file: Generalize kexec_add_buffer.
+
+Thiago Jung Bauermann (13):
+ kexec_file: Allow arch-specific memory walking for kexec_add_buffer
+ kexec_file: Change kexec_add_buffer to take kexec_buf as argument.
kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.
powerpc: Factor out relocation code from module_64.c to elf_util_64.c.
powerpc: Generalize elf64_apply_relocate_add.
+ powerpc: Adapt elf64_apply_relocate_add for kexec_file_load.
powerpc: Add functions to read ELF files of any endianness.
powerpc: Implement kexec_file_load.
+ powerpc: Add code to work with device trees in kexec_file_load.
powerpc: Add support for loading ELF kernels with kexec_file_load.
+ powerpc: Allow userspace to set device tree properties in
+ kexec_file_load
powerpc: Add purgatory for kexec_file_load implementation.
+ powerpc: Enable CONFIG_KEXEC_FILE in powerpc server defconfigs.
arch/powerpc/Kconfig | 13 +
arch/powerpc/Makefile | 4 +
- arch/powerpc/include/asm/elf_util.h | 92 +++++
+ arch/powerpc/configs/powernv_defconfig | 2 +
+ arch/powerpc/configs/ppc64_defconfig | 2 +
+ arch/powerpc/configs/pseries_defconfig | 2 +
+ arch/powerpc/include/asm/elf_util.h | 92 ++++
+ arch/powerpc/include/asm/kexec.h | 11 +
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 | 374 ++++++++++++++++++++
- arch/powerpc/kernel/kexec_elf_64.c | 560 ++++++++++++++++++++++++++++++
- arch/powerpc/kernel/machine_kexec_64.c | 134 +++++++
- arch/powerpc/kernel/module_64.c | 328 +++--------------
+ arch/powerpc/kernel/elf_util.c | 476 ++++++++++++++++++++
+ arch/powerpc/kernel/elf_util_64.c | 374 ++++++++++++++++
+ arch/powerpc/kernel/kexec_elf_64.c | 291 ++++++++++++
+ arch/powerpc/kernel/machine_kexec_64.c | 719 ++++++++++++++++++++++++++++++
+ arch/powerpc/kernel/module_64.c | 328 ++------------
arch/powerpc/purgatory/.gitignore | 2 +
arch/powerpc/purgatory/Makefile | 36 ++
arch/powerpc/purgatory/console-ppc64.c | 38 ++
- arch/powerpc/purgatory/crashdump-ppc64.h | 42 +++
+ arch/powerpc/purgatory/crashdump-ppc64.h | 42 ++
arch/powerpc/purgatory/crashdump_backup.c | 36 ++
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 | 20 ++
- arch/powerpc/purgatory/printf.c | 164 +++++++++
- arch/powerpc/purgatory/purgatory-ppc64.c | 41 +++
+ arch/powerpc/purgatory/ppc64_asm.h | 20 +
+ arch/powerpc/purgatory/printf.c | 164 +++++++
+ arch/powerpc/purgatory/purgatory-ppc64.c | 41 ++
arch/powerpc/purgatory/purgatory-ppc64.h | 6 +
- arch/powerpc/purgatory/purgatory.c | 62 ++++
+ arch/powerpc/purgatory/purgatory.c | 62 +++
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 | 134 +++++++
- include/linux/kexec.h | 23 +-
- kernel/kexec_file.c | 100 ++++--
+ arch/powerpc/purgatory/v2wrap.S | 134 ++++++
+ arch/x86/kernel/crash.c | 37 +-
+ arch/x86/kernel/kexec-bzimage64.c | 48 +-
+ include/linux/kexec.h | 33 +-
+ kernel/kexec_file.c | 141 +++---
kernel/kexec_internal.h | 16 -
- 36 files changed, 2476 insertions(+), 330 deletions(-)
+ 42 files changed, 2869 insertions(+), 406 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