xref: /linux/arch/riscv/kernel/vmcore_info.c (revision 566ab427f827b0256d3e8ce0235d088e6a9c28bd)
1 // SPDX-License-Identifier: GPL-2.0-only
2 
3 #include <linux/vmcore_info.h>
4 #include <linux/pagemap.h>
5 
6 void arch_crash_save_vmcoreinfo(void)
7 {
8 	VMCOREINFO_NUMBER(phys_ram_base);
9 
10 	vmcoreinfo_append_str("NUMBER(PAGE_OFFSET)=0x%lx\n", PAGE_OFFSET);
11 	vmcoreinfo_append_str("NUMBER(VMALLOC_END)=0x%lx\n", VMALLOC_END);
12 #ifdef CONFIG_MMU
13 	VMCOREINFO_NUMBER(VA_BITS);
14 	vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START);
15 	vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END);
16 #ifdef CONFIG_64BIT
17 	vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR);
18 	vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END);
19 #endif
20 #endif
21 	vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR);
22 #ifdef CONFIG_XIP_KERNEL
23 	/* TODO: Communicate with crash-utility developers on the information to
24 	 * export. The XIP case is more complicated, because the virtual-physical
25 	 * address offset depends on whether the address is in ROM or in RAM.
26 	 */
27 #else
28 	vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
29 						kernel_map.va_kernel_pa_offset);
30 #endif
31 }
32