summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Kim <austin.kim@lge.com>2026-04-05 03:42:40 +0300
committerPaul Walmsley <pjw@kernel.org>2026-04-05 03:42:40 +0300
commitd8e99133eb4a8d09dcbf71f7277dc948d3413227 (patch)
tree1e6e6e12d012f5f97ab75206eee2840036a89d15
parentce3a360a6d0b3d2b2a23238ff1b7a4ac1280d196 (diff)
downloadlinux-d8e99133eb4a8d09dcbf71f7277dc948d3413227.tar.xz
riscv: export kaslr offset and satp in VMCOREINFO ELF notes
The following options are required by the kdump crash utility for RISC-V based vmcore file: - kaslr: If the vmcore is generated from a KASLR-enabled Linux kernel, the KASLR offset is required for the crash utility to load the vmcore. Without the proper kaslr option, the crash utility fails to load the vmcore file. - satp: The exact root page table address helps determine the correct base PGD address. With this patch, RISC-V VMCOREINFO ELF notes now include both kaslr and satp information. Signed-off-by: Austin Kim <austin.kim@lge.com> Link: https://patch.msgid.link/aYwKUE3ZzN7/ZY/A@adminpc-PowerEdge-R7525 Signed-off-by: Paul Walmsley <pjw@kernel.org>
-rw-r--r--arch/riscv/kernel/vmcore_info.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/riscv/kernel/vmcore_info.c b/arch/riscv/kernel/vmcore_info.c
index d5e448aa90e7..682ba423cf20 100644
--- a/arch/riscv/kernel/vmcore_info.c
+++ b/arch/riscv/kernel/vmcore_info.c
@@ -3,6 +3,11 @@
#include <linux/vmcore_info.h>
#include <linux/pagemap.h>
+static inline u64 get_satp_value(void)
+{
+ return csr_read(CSR_SATP);
+}
+
void arch_crash_save_vmcoreinfo(void)
{
VMCOREINFO_NUMBER(phys_ram_base);
@@ -27,5 +32,7 @@ void arch_crash_save_vmcoreinfo(void)
#else
vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
kernel_map.va_kernel_pa_offset);
+ vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
+ vmcoreinfo_append_str("NUMBER(satp)=0x%llx\n", get_satp_value());
#endif
}