[PATCH 5/5] arm64: lib: Use MOPS for copy_page() and clear_page()

Catalin Marinas catalin.marinas at arm.com
Wed Oct 2 08:37:56 PDT 2024


On Mon, Sep 30, 2024 at 05:10:51PM +0100, Kristina Martsenko wrote:
> Similarly to what was done to the memcpy() routines, make copy_page()
> and clear_page() also use the Armv8.8 FEAT_MOPS instructions.
> 
> Note: For copy_page() this uses the CPY* instructions instead of CPYF*
> as CPYF* doesn't allow src and dst to be equal. It's not clear if
> copy_page() needs to allow equal src and dst but it has worked so far
> with the current implementation and there is no documentation forbidding
> it.

When we get real hardware, if CPYF* is faster we should switch to these
instructions. I wouldn't expect source and destination to be the same
but we can add a check.

>  SYM_FUNC_START(__pi_copy_page)
> +#ifdef CONFIG_AS_HAS_MOPS
> +	.arch_extension mops
> +alternative_if_not ARM64_HAS_MOPS
> +	b	.Lno_mops
> +alternative_else_nop_endif

Same comment as on the previous patch w.r.t. the branch.

-- 
Catalin



More information about the linux-arm-kernel mailing list