[PW_SID:1071604] Add crashdump support in guest kernel#1665
[PW_SID:1071604] Add crashdump support in guest kernel#1665linux-riscv-bot wants to merge 4 commits into
Conversation
When CONFIG_KEXEC_CORE is enabled, add a dedicated .kexec.tramp.text area to the RISC-V kernel linker script. This introduces a KEXEC_TRAMP_TEXT linker snippet in image-vars.h and uses it from vmlinux.lds.S to: - align to PAGE_SIZE - define __kexec_tramp_text_start/__kexec_tramp_text_end - KEEP all .kexec.tramp.text* input sections - ASSERT the trampoline text fits within one page When kexec is disabled, KEXEC_TRAMP_TEXT expands to nothing. Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Move riscv_kexec_norelocate out of the generic .text section and into a dedicated executable trampoline section, .kexec.tramp.text. Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Crash kexec uses riscv_kexec_norelocate as a trampoline to jump into the crashkernel. Add a small helper to build dedicated 4KB page tables that map the trampoline page as executable. Two mappings are installed: - VA(__kexec_tramp_text_start) -> PA(__kexec_tramp_text_start) - PA(__kexec_tramp_text_start) -> PA(__kexec_tramp_text_start) This allows the trampoline to run regardless of whether it is entered via its linked virtual address or its physical address. Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Make riscv_kexec_norelocate a two-pass trampoline so it can drop the kernel page tables while still executing from a mapped address. On the first entry, t3 is initialized to 0 by machine_kexec(). Loads the physical address of riscv_kexec_norelocate and the trampoline SATP value, switches to the trampoline page table, and jumps to the trampoline VA(=PA). On the second entry, t3 contains the physical address of riscv_kexec_norelocate, so the PC comparison matches and execution continues under trampoline VA(=PA). Since the trampoline page table is already active, replace the previous stvec-based handoff with a direct jump to the target entry (jr a2). Signed-off-by: Fangyu Yu <fangyu.yu@linux.alibaba.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 1: "[1/4] riscv: Add kexec trampoline text section to vmlinux.lds.S" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 2: "[2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 3: "[3/4] riscv: kexec: Build trampoline page tables for crash kernel entry" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
|
Patch 4: "[4/4] riscv: kexec: Switch to trampoline page table before norelocate" |
PR for series 1071604 applied to workflow__riscv__fixes
Name: Add crashdump support in guest kernel
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1071604
Version: 1