[PATCH v2 0/2] Fix riscv64 virtual-to-physical address translation
HAGIO KAZUHITO(萩尾 一仁)
k-hagio-ab at nec.com
Mon May 18 01:33:11 PDT 2026
On 2026/05/15 17:07, Rui Qi wrote:
> This patchset fixes two bugs in the riscv64 architecture support of
> makedumpfile related to virtual-to-physical address translation.
>
> Patch 1 fixes vaddr_to_paddr_riscv64() to exclude vmalloc and vmemmap
> regions from the VTOP() fast path. These regions are not linearly mapped
> and must go through page table walk.
>
> Patch 2 fixes vtop_riscv64() to correctly handle huge pages when
> _PAGE_LEAF is set at PGD/P4D/PUD/PMD level. The original code incorrectly
> fell through to the next level, causing wrong physical address computation.
>
>
> Changes in v2:
> - Patch 2: Changed `goto invalid;` to `return paddr;` when huge page
> (_PAGE_LEAF) hits, as the calculated physical address is valid.
> - Patch 2: Removed the unused `out:` label to fix a compiler warning.
Thank you for the update, applied.
Thanks,
Kazu
>
> Rui Qi (2):
> riscv64: Fix vaddr_to_paddr for vmalloc and vmemmap regions
> riscv64: Fix huge page translation in vtop_riscv64()
>
> arch/riscv64.c | 31 +++++++++++++++++++++----------
> 1 file changed, 21 insertions(+), 10 deletions(-)
>
More information about the kexec
mailing list