mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 09:22:27 +00:00
Since RISC-V Linux v6.4, the commit3335068f87("riscv: Use PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base from the physical start of the kernel to the actual start of the DRAM. The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr to translate kernel virtual address, that failed the Crash with Linux v6.4 [1]. Export kernel_map.va_kernel_pa_offset in vmcoreinfo to help Crash translate the kernel virtual address correctly. Fixes:3335068f87("riscv: Use PUD/P4D/PGD pages for the linear mapping") Link: https://lore.kernel.org/linux-riscv/[email protected]/ [1] Signed-off-by: Song Shuai <[email protected]> Reviewed-by: Xianting Tian <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
24 lines
901 B
C
24 lines
901 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
#include <linux/crash_core.h>
|
|
#include <linux/pagemap.h>
|
|
|
|
void arch_crash_save_vmcoreinfo(void)
|
|
{
|
|
VMCOREINFO_NUMBER(VA_BITS);
|
|
VMCOREINFO_NUMBER(phys_ram_base);
|
|
|
|
vmcoreinfo_append_str("NUMBER(PAGE_OFFSET)=0x%lx\n", PAGE_OFFSET);
|
|
vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START);
|
|
vmcoreinfo_append_str("NUMBER(VMALLOC_END)=0x%lx\n", VMALLOC_END);
|
|
vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START);
|
|
vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END);
|
|
#ifdef CONFIG_64BIT
|
|
vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR);
|
|
vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END);
|
|
#endif
|
|
vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR);
|
|
vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
|
|
kernel_map.va_kernel_pa_offset);
|
|
}
|