On Fri, Nov 14, 2025 at 02:58:50PM -0800, Eric Biggers wrote:
+/**
- memcpy_sglist() - Copy data from one scatterlist to another
- @dst: The destination scatterlist. Can be NULL if @nbytes == 0.
- @src: The source scatterlist. Can be NULL if @nbytes == 0.
- @nbytes: Number of bytes to copy
- The scatterlists can overlap. Hence this really acts like memmove(), not
- memcpy().
- Context: Any context
- */
[...]
if (src_virt != dst_virt) {memmove(dst_virt, src_virt, len);if (ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE)__scatterwalk_flush_dcache_pages(dst_page, dst_offset, len);}
I realized that this doesn't correctly handle arbitrary overlaps in the case where there are multiple copy steps. So, my idea to make this function more robust by allowing arbitrary overlaps won't easily work. I'll send a revised version that only claims to support exact overlaps, which is consistent with the current code.
- Eric