Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

riscv: mm: define copy_user_page() as copy_page()

Currently, the implementation of copy_user_page() is identical to
copy_page().

Align riscv with other architectures (alpha, arc, arm64, hexagon,
longarch, m68k, openrisc, s390, um, xtensa) and map copy_user_page()
to copy_page() given that their implementation is identical.

In addition to following a common pattern, this centralizes the
implementation. Any changes to the underlying page copy logic (e.g.,
for CHERI) will now automatically propagate to copy_user_page().

Signed-off-by: Florian Schmaus <florian.schmaus@codasip.com>
Link: https://patch.msgid.link/20260113134025.905627-1-florian.schmaus@codasip.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>

authored by

Florian Schmaus and committed by
Paul Walmsley
9f77b4c5 28a12ef3

+1 -2
+1 -2
arch/riscv/include/asm/page.h
··· 51 51 #define copy_page(to, from) memcpy((to), (from), PAGE_SIZE) 52 52 53 53 #define clear_user_page(pgaddr, vaddr, page) clear_page(pgaddr) 54 - #define copy_user_page(vto, vfrom, vaddr, topg) \ 55 - memcpy((vto), (vfrom), PAGE_SIZE) 54 + #define copy_user_page(vto, vfrom, vaddr, topg) copy_page(vto, vfrom) 56 55 57 56 /* 58 57 * Use struct definitions to apply C type checking