]> www.infradead.org Git - users/jedix/linux-maple.git/commit
s390/kdump: Provide is_kdump_kernel() implementation
authorDavid Hildenbrand <david@redhat.com>
Wed, 23 Oct 2024 09:06:51 +0000 (11:06 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 25 Oct 2024 14:03:23 +0000 (16:03 +0200)
commit82a0fcb1ad03e2268b5376d78107042d64119e3d
tree31e2a625be37f1ca8eeac92d04be998a48177a37
parent2835f8bf5530750c3381166005934f996a83ad05
s390/kdump: Provide is_kdump_kernel() implementation

s390 sets "elfcorehdr_addr = ELFCORE_ADDR_MAX;" early during
setup_arch() to deactivate the "elfcorehdr= kernel" parameter,
resulting in is_kdump_kernel() returning "false".

During vmcore_init()->elfcorehdr_alloc(), if on a dump kernel and
allocation succeeded, elfcorehdr_addr will be set to a valid address
and is_kdump_kernel() will consequently return "true".

is_kdump_kernel() should return a consistent result during all boot
stages, and properly return "true" if in a kdump environment - just
like it is done on powerpc where "false" is indicated in fadump
environments, as added in commit b098f1c32365 ("powerpc/fadump: make
is_kdump_kernel() return false when fadump is active").

Similarly provide a custom is_kdump_kernel() implementation that will only
return "true" in kdump environments, and will do so consistently during
boot.

Update the documentation of dump_available().

Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Link: https://lore.kernel.org/r/20241023090651.1115507-1-david@redhat.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/kexec.h
arch/s390/kernel/crash_dump.c
arch/s390/kernel/smp.c