Skip to content

Commit f2df5b4

Browse files
covanampalmer-dabbelt
authored andcommitted
riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel
The crash utility uses va_kernel_pa_offset to translate virtual addresses. This is incorrect in the case of XIP kernel, because va_kernel_pa_offset is not the virtual-physical address offset (yes, the name is misleading; this variable will be removed for XIP in a following commit). Stop exporting this variable for XIP kernel. The replacement is to be determined, note it as a TODO for now. Signed-off-by: Nam Cao <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/8f8760d3f9a11af4ea0acbc247e4f49ff5d317e9.1717789719.git.namcao@linutronix.de Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent aa3457f commit f2df5b4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/riscv/kernel/vmcore_info.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ void arch_crash_save_vmcoreinfo(void)
1919
#endif
2020
#endif
2121
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
2228
vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n",
2329
kernel_map.va_kernel_pa_offset);
30+
#endif
2431
}

0 commit comments

Comments
 (0)