linux-stable/arch/powerpc/kexec
Hari Bathini b5667d13be powerpc/kexec_file: Fix kexec load failure with lack of memory hole
The kexec purgatory has to run in real mode. Only the first memory
block maybe accessible in real mode. And, unlike the case with panic
kernel, no memory is set aside for regular kexec load. Another thing
to note is, the memory for crashkernel is reserved at an offset of
128MB. So, when crashkernel memory is reserved, the memory ranges to
load kexec segments shrink further as the generic code only looks for
memblock free memory ranges and in all likelihood only a tiny bit of
memory from 0 to 128MB would be available to load kexec segments.

With kdump being used by default in general, kexec file load is likely
to fail almost always. This can be fixed by changing the memory hole
lookup logic for regular kexec to use the same method as kdump. This
would mean that most kexec segments will overlap with crashkernel
memory region. That should still be ok as the pages, whose destination
address isn't available while loading, are placed in an intermediate
location till a flush to the actual destination address happens during
kexec boot sequence.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Tested-by: Pingfan Liu <piliu@redhat.com>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/159602302326.575379.14038896654942043093.stgit@hbathini
2020-07-29 23:47:54 +10:00
..
core.c powerpc/crashkernel: Take "mem=" option into account 2020-06-02 20:59:05 +10:00
core_32.c
core_64.c powerpc/book3s64/keys/kuap: Reset AMR/IAMR values on kexec 2020-07-20 22:57:59 +10:00
crash.c powerpc/crash: Use NMI context for printk when starting to crash 2020-06-02 20:59:07 +10:00
elf_64.c powerpc/kexec_file: Prepare elfcore header for crashing kernel 2020-07-29 23:47:54 +10:00
file_load.c powerpc/kexec_file: Prepare elfcore header for crashing kernel 2020-07-29 23:47:54 +10:00
file_load_64.c powerpc/kexec_file: Fix kexec load failure with lack of memory hole 2020-07-29 23:47:54 +10:00
ima.c
Makefile powerpc/kexec_file: Add helper functions for getting memory ranges 2020-07-29 23:47:53 +10:00
ranges.c powerpc/kexec_file: Avoid stomping memory used by special regions 2020-07-29 23:47:53 +10:00
relocate_32.S