Commit 45cad9a6 authored by Youling Tang's avatar Youling Tang Committed by Hongchen Zhang
Browse files

LoongArch: kdump: Add single kernel image implementation

LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I736HO



--------------------------------

This feature depends on the kernel being relocatable.

Enable using single kernel image for kdump, and then no longer need to
build two kernels (production kernel and capture kernel share a single
kernel image).

Signed-off-by: default avatarYouling Tang <tangyouling@loongson.cn>
Change-Id: I28a3f91cef4ea9e54eacb573754f0c16ec744bf6
parent a836141a
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -476,6 +476,7 @@ config KEXEC

config CRASH_DUMP
	bool "Build kdump crash kernel"
	select RELOCATABLE
	help
	  Generate crash dump after being started by kexec. This should
	  be normally only set in special crash dump kernels which are
@@ -485,17 +486,6 @@ config CRASH_DUMP

	  For more details see Documentation/admin-guide/kdump/kdump.rst

config PHYSICAL_START
	hex "Physical address where the kernel is loaded"
	default "0x90000000a0000000"
	depends on CRASH_DUMP
	help
	  This gives the XKPRANGE address where the kernel is loaded.
	  If you plan to use kernel for capturing the crash dump change
	  this value to start of the reserved region (the "X" value as
	  specified in the "crashkernel=YM@XM" command line boot parameter
	  passed to the panic-ed kernel).

config RELOCATABLE
	bool "Relocatable kernel"
	help
+0 −4
Original line number Diff line number Diff line
@@ -71,11 +71,7 @@ endif
cflags-y += -ffreestanding
cflags-y += $(call cc-option, -mno-check-zero-division)

ifndef CONFIG_PHYSICAL_START
load-y		= 0x9000000000200000
else
load-y		= $(CONFIG_PHYSICAL_START)
endif
bootvars-y	= VMLINUX_LOAD_ADDRESS=$(load-y)

drivers-$(CONFIG_PCI)		+= arch/loongarch/pci/
+2 −0
Original line number Diff line number Diff line
@@ -126,4 +126,6 @@ extern unsigned long vm_map_base;
#define IO_SPACE_LIMIT	(PCI_IOSIZE - 1)
#define ISA_PHY_IOBASE  LOONGSON_LIO_BASE

#define PHYS_LINK_KADDR	PHYSADDR(VMLINUX_LOAD_ADDRESS)

#endif /* _ASM_ADDRSPACE_H */
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ _head:
	.org	0x8
	.dword	kernel_entry		/* Kernel entry point */
	.dword	_end - _text		/* Kernel image effective size */
	.quad	0			/* Kernel image load offset from start of RAM */
	.quad	PHYS_LINK_KADDR		/* Kernel image load offset from start of RAM */
	.org	0x3c			/* 0x20 ~ 0x3b reserved */
	.long	pe_header - _head	/* Offset to the PE header */