Re: [PATCH v5 01/17] kexec: Fix CMA segment address translation with non-zero text_offset

[email protected]
Newsgroups org.kernel.vger.linux-fsdevel,dev.linux.lists.driver-core,dev.linux.lists.loongarch,org.kernel.vger.linux-kernel,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev
Message-ID <[email protected]>
> kimage_load_cma_segment() and kimage_map_segment() translate a CMA
> segment to a kernel virtual address with page_address(cma), ignoring
> segment->mem. But arm64's image_load() adds text_offset to segment->mem,
> so the kernel payload is copied to the wrong offset while image->start
> points past it, and kexec jumps into the middle of the kernel.
> kimage_map_segment() has the same problem for any CMA segment whose mem
> was moved.
> 
> Add kimage_cma_vaddr() to translate a boot physical address inside a CMA
> segment to its virtual address, and use it in both places.
> 
> Cc: Andrew Morton <[email protected]>
> Cc: Baoquan He <[email protected]>
> Cc: Mike Rapoport <[email protected]>
> Cc: Pasha Tatashin <[email protected]>
> Cc: Pratyush Yadav <[email protected]>
> Cc: Pingfan Liu <[email protected]>
> Cc: Justinien Bouron <[email protected]>
> Cc: Sourabh Jain <[email protected]>
> Cc: [email protected]
> Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation")
> Signed-off-by: Jinjie Ruan <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.