OSDN Git Service

powerpc/kexec_file: Add helper functions for getting memory ranges
authorHari Bathini <hbathini@linux.ibm.com>
Wed, 29 Jul 2020 11:40:00 +0000 (17:10 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jul 2020 13:47:53 +0000 (23:47 +1000)
commit180adfc532a83c1d74146449f7385f767d4b8059
tree2a74967724a2c48b524154d3fb2d063640de28fa
parent19031275a5881233b4fc31b7dee68bf0b0758bbc
powerpc/kexec_file: Add helper functions for getting memory ranges

In kexec case, the kernel to be loaded uses the same memory layout as
the running kernel. So, passing on the DT of the running kernel would
be good enough.

But in case of kdump, different memory ranges are needed to manage
loading the kdump kernel, booting into it and exporting the elfcore of
the crashing kernel. The ranges are exclude memory ranges, usable
memory ranges, reserved memory ranges and crash memory ranges.

Exclude memory ranges specify the list of memory ranges to avoid while
loading kdump segments. Usable memory ranges list the memory ranges
that could be used for booting kdump kernel. Reserved memory ranges
list the memory regions for the loading kernel's reserve map. Crash
memory ranges list the memory ranges to be exported as the crashing
kernel's elfcore.

Add helper functions for setting up the above mentioned memory ranges.
This helpers facilitate in understanding the subsequent changes better
and make it easy to setup the different memory ranges listed above, as
and when appropriate.

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/159602279194.575379.8526552316948643550.stgit@hbathini
arch/powerpc/include/asm/kexec_ranges.h [new file with mode: 0644]
arch/powerpc/kexec/Makefile
arch/powerpc/kexec/ranges.c [new file with mode: 0644]