diff options
author | Youling Tang <tangyouling@loongson.cn> | 2022-10-12 10:36:19 +0200 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-10-12 10:36:19 +0200 |
commit | 4a03b2ac06a5bcae29371866d9d11f5bfd4c9188 (patch) | |
tree | b4be8ab432c4fd77b484dbc4445de8a609444197 /arch/loongarch/kernel/head.S | |
parent | LoongArch: Use generic BUG() handler (diff) | |
download | linux-4a03b2ac06a5bcae29371866d9d11f5bfd4c9188.tar.xz linux-4a03b2ac06a5bcae29371866d9d11f5bfd4c9188.zip |
LoongArch: Add kexec support
Add three new files, kexec.h, machine_kexec.c and relocate_kernel.S to
the LoongArch architecture, so as to add support for the kexec re-boot
mechanism (CONFIG_KEXEC) on LoongArch platforms.
Kexec supports loading vmlinux.elf in ELF format and vmlinux.efi in PE
format.
I tested kexec on LoongArch machines (Loongson-3A5000) and it works as
expected:
$ sudo kexec -l /boot/vmlinux.efi --reuse-cmdline
$ sudo kexec -e
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/head.S')
-rw-r--r-- | arch/loongarch/kernel/head.S | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S index d32128f1d3c4..97425779ce9f 100644 --- a/arch/loongarch/kernel/head.S +++ b/arch/loongarch/kernel/head.S @@ -21,7 +21,11 @@ _head: .word MZ_MAGIC /* "MZ", MS-DOS header */ - .org 0x3c /* 0x04 ~ 0x3b reserved */ + .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 */ + .org 0x3c /* 0x20 ~ 0x3b reserved */ .long pe_header - _head /* Offset to the PE header */ pe_header: |