[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXiF55y5D49gcpUg@adminpc-PowerEdge-R7525>
Date: Tue, 27 Jan 2026 18:31:19 +0900
From: Austin Kim <austindh.kim@...il.com>
To: Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>,
Alexandre Ghiti <alex@...ti.fr>, Albert Ou <aou@...s.berkeley.edu>
Cc: linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
austindh.kim@...il.com
Subject: [PATCH] riscv: export kaslr offset and satp in VMCOREINFO ELF notes
From: Austin Kim <austin.kim@....com>
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@....com>
---
arch/riscv/kernel/vmcore_info.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/riscv/kernel/vmcore_info.c b/arch/riscv/kernel/vmcore_info.c
index d5e448aa9..682ba423c 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
}
--
2.34.1
Powered by blists - more mailing lists