• Nam Cao's avatar
    riscv: replace misleading va_kernel_pa_offset on XIP kernel · 5cf08967
    Nam Cao authored
    On XIP kernel, the name "va_kernel_pa_offset" is misleading: unlike
    "normal" kernel, it is not the virtual-physical address offset of kernel
    mapping, it is the offset of kernel mapping's first virtual address to
    first physical address in DRAM, which is not meaningful because the
    kernel's first physical address is not in DRAM.
    
    For XIP kernel, there are 2 different offsets because the read-only part of
    the kernel resides in ROM while the rest is in RAM. The offset to ROM is in
    kernel_map.va_kernel_xip_pa_offset, while the offset to RAM is not stored
    anywhere: it is calculated on-the-fly.
    
    Remove this confusing "va_kernel_pa_offset" and add
    "va_kernel_xip_data_pa_offset" as its replacement. This new variable is the
    offset of virtual mapping of the kernel's data portion to the corresponding
    physical addresses.
    
    With the introduction of this new variable, also rename
    va_kernel_xip_pa_offset -> va_kernel_xip_text_pa_offset to make it clear
    that this one is about the .text section.
    Signed-off-by: default avatarNam Cao <namcao@linutronix.de>
    Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
    Link: https://lore.kernel.org/r/84e5d005c1386d88d7b2531e0b6707ec5352ee54.1717789719.git.namcao@linutronix.deSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
    5cf08967
page.h 6.2 KB