Commit 3f89765d authored by Youling Tang's avatar Youling Tang Committed by Huacai Chen

LoongArch: kdump: Add single kernel image implementation

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).

Also enable CONFIG_CRASH_DUMP in loongson3_defconfig.
Signed-off-by: default avatarYouling Tang <tangyouling@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent e5f02b51
...@@ -473,6 +473,7 @@ config KEXEC ...@@ -473,6 +473,7 @@ config KEXEC
config CRASH_DUMP config CRASH_DUMP
bool "Build kdump crash kernel" bool "Build kdump crash kernel"
select RELOCATABLE
help help
Generate crash dump after being started by kexec. This should Generate crash dump after being started by kexec. This should
be normally only set in special crash dump kernels which are be normally only set in special crash dump kernels which are
...@@ -482,17 +483,6 @@ config CRASH_DUMP ...@@ -482,17 +483,6 @@ config CRASH_DUMP
For more details see Documentation/admin-guide/kdump/kdump.rst 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 config RELOCATABLE
bool "Relocatable kernel" bool "Relocatable kernel"
help help
......
...@@ -79,11 +79,7 @@ endif ...@@ -79,11 +79,7 @@ endif
cflags-y += -ffreestanding cflags-y += -ffreestanding
cflags-y += $(call cc-option, -mno-check-zero-division) cflags-y += $(call cc-option, -mno-check-zero-division)
ifndef CONFIG_PHYSICAL_START
load-y = 0x9000000000200000 load-y = 0x9000000000200000
else
load-y = $(CONFIG_PHYSICAL_START)
endif
bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y) bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)
drivers-$(CONFIG_PCI) += arch/loongarch/pci/ drivers-$(CONFIG_PCI) += arch/loongarch/pci/
......
...@@ -48,6 +48,7 @@ CONFIG_HOTPLUG_CPU=y ...@@ -48,6 +48,7 @@ CONFIG_HOTPLUG_CPU=y
CONFIG_NR_CPUS=64 CONFIG_NR_CPUS=64
CONFIG_NUMA=y CONFIG_NUMA=y
CONFIG_KEXEC=y CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
CONFIG_SUSPEND=y CONFIG_SUSPEND=y
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
CONFIG_ACPI=y CONFIG_ACPI=y
......
...@@ -125,4 +125,6 @@ extern unsigned long vm_map_base; ...@@ -125,4 +125,6 @@ extern unsigned long vm_map_base;
#define ISA_IOSIZE SZ_16K #define ISA_IOSIZE SZ_16K
#define IO_SPACE_LIMIT (PCI_IOSIZE - 1) #define IO_SPACE_LIMIT (PCI_IOSIZE - 1)
#define PHYS_LINK_KADDR PHYSADDR(VMLINUX_LOAD_ADDRESS)
#endif /* _ASM_ADDRSPACE_H */ #endif /* _ASM_ADDRSPACE_H */
...@@ -24,7 +24,7 @@ _head: ...@@ -24,7 +24,7 @@ _head:
.org 0x8 .org 0x8
.dword kernel_entry /* Kernel entry point */ .dword kernel_entry /* Kernel entry point */
.dword _end - _text /* Kernel image effective size */ .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 0x38 /* 0x20 ~ 0x37 reserved */ .org 0x38 /* 0x20 ~ 0x37 reserved */
.long LINUX_PE_MAGIC .long LINUX_PE_MAGIC
.long pe_header - _head /* Offset to the PE header */ .long pe_header - _head /* Offset to the PE header */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment