From: Austin Kim <austindh.kim@gmail.com>
To: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
austindh.kim@gmail.com
Subject: [PATCH] riscv: export kaslr offset and satp in VMCOREINFO ELF notes
Date: Tue, 27 Jan 2026 18:31:19 +0900 [thread overview]
Message-ID: <aXiF55y5D49gcpUg@adminpc-PowerEdge-R7525> (raw)
From: Austin Kim <austin.kim@lge.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@lge.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
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Austin Kim <austindh.kim@gmail.com>
To: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
austindh.kim@gmail.com
Subject: [PATCH] riscv: export kaslr offset and satp in VMCOREINFO ELF notes
Date: Tue, 27 Jan 2026 18:31:19 +0900 [thread overview]
Message-ID: <aXiF55y5D49gcpUg@adminpc-PowerEdge-R7525> (raw)
From: Austin Kim <austin.kim@lge.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@lge.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
next reply other threads:[~2026-01-27 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 9:31 Austin Kim [this message]
2026-01-27 9:31 ` [PATCH] riscv: export kaslr offset and satp in VMCOREINFO ELF notes Austin Kim
2026-01-27 19:13 ` kernel test robot
2026-01-27 19:13 ` kernel test robot
2026-01-28 10:36 ` Austin Kim
2026-01-28 10:36 ` Austin Kim
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=aXiF55y5D49gcpUg@adminpc-PowerEdge-R7525 \
--to=austindh.kim@gmail.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.