From: Youling Tang <tangyouling@loongson.cn>
To: Huacai Chen <chenhuacai@kernel.org>, Baoquan He <bhe@redhat.com>,
Eric Biederman <ebiederm@xmission.com>
Cc: WANG Xuerui <kernel@xen0n.name>, Vivek Goyal <vgoyal@redhat.com>,
Dave Young <dyoung@redhat.com>, Guo Ren <guoren@kernel.org>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
kexec@lists.infradead.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/3] LoongArch: Add kexec/kdump support
Date: Thu, 15 Sep 2022 10:53:43 +0800 [thread overview]
Message-ID: <1663210426-15446-1-git-send-email-tangyouling@loongson.cn> (raw)
This patch series to support kexec/kdump (only 64bit).
Kexec is a system call that enables you to load and boot into another kernel
from the currently running kernel. This is useful for kernel developers or
other people who need to reboot very quickly without waiting for the whole
BIOS boot process to finish.
Kdump uses kexec to quickly boot to a dump-capture kernel whenever a
dump of the system kernel's memory needs to be taken (for example, when
the system panics). The system kernel's memory image is preserved across
the reboot and is accessible to the dump-capture kernel.
For details, see Documentation/admin-guide/kdump/kdump.rst.
User tools kexec-tools see link [1].
TODO:
Currently kdump does not support the same binary image, the production kernel
and the capture kernel will be generated with different configurations. I will
support kernel relocation support in the near future. Then will go to implement
the same binary support based on kernel relocation support.
[1] Link: https://github.com/tangyouling/kexec-tools
Changes in v3:
- Adjust the PE header (note that kexec-tools needs to be updated).
- Add ibar in kexec_reboot().
- boot_flag is replaced by efi_boot.
- Adjust do_kexec parameter passing order.
- Adjust the order of static variables to be consistent with do_kexec.
- Remove a-series register save.
- Some comments and register usage modification.
- Add the opening and closing of the cpu core state.
- Add a call to cpu_device_up to turn it on when the cpu core state is offline.
Changes in v2:
- Add ibar.
- Access via IOCSR.
- Remove the settings of the tp, sp registers.
- Remove the crash.c file and merge the relevant code into machine_kexec.c.
- Adjust the use of CONFIG_SMP macro to avoid build errors under !SMP
configuration.
- Change the default value of PHYSICAL_START of the capture kernel to
0x90000000a0000000.
Youling Tang (3):
LoongArch: Add kexec support
LoongArch: Add kdump support
LoongArch: Enable CONFIG_KEXEC
arch/loongarch/Kconfig | 33 +++
arch/loongarch/Makefile | 4 +
arch/loongarch/configs/loongson3_defconfig | 1 +
arch/loongarch/include/asm/kexec.h | 58 ++++
arch/loongarch/kernel/Makefile | 3 +
arch/loongarch/kernel/crash_dump.c | 19 ++
arch/loongarch/kernel/head.S | 6 +-
arch/loongarch/kernel/machine_kexec.c | 295 +++++++++++++++++++++
arch/loongarch/kernel/mem.c | 6 +
arch/loongarch/kernel/relocate_kernel.S | 111 ++++++++
arch/loongarch/kernel/setup.c | 49 ++++
arch/loongarch/kernel/traps.c | 4 +
12 files changed, 588 insertions(+), 1 deletion(-)
create mode 100644 arch/loongarch/include/asm/kexec.h
create mode 100644 arch/loongarch/kernel/crash_dump.c
create mode 100644 arch/loongarch/kernel/machine_kexec.c
create mode 100644 arch/loongarch/kernel/relocate_kernel.S
--
2.36.0
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next reply other threads:[~2022-09-15 2:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 2:53 Youling Tang [this message]
2022-09-15 2:53 ` [PATCH v3 1/3] LoongArch: Add kexec support Youling Tang
2022-09-22 10:00 ` Xi Ruoyao
2022-09-22 10:30 ` Youling Tang
2022-09-15 2:53 ` [PATCH v3 2/3] LoongArch: Add kdump support Youling Tang
2022-09-15 2:53 ` [PATCH v3 3/3] LoongArch: Enable CONFIG_KEXEC Youling Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1663210426-15446-1-git-send-email-tangyouling@loongson.cn \
--to=tangyouling@loongson.cn \
--cc=bhe@redhat.com \
--cc=chenhuacai@kernel.org \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=guoren@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox