Message ID | 20240930161051.3777828-1-kristina.martsenko@arm.com (mailing list archive) |
---|---|
Headers | show |
Series | arm64: Use memory copy instructions in kernel routines | expand |
On Mon, Sep 30, 2024 at 05:10:46PM +0100, Kristina Martsenko wrote: > This series makes the memcpy(), memmove() and memset() routines use the > CPY/SET instructions, as well as copy_page() and clear_page(). Another function we should optimise is mte_zero_clear_page_tags() using SETG*.
On 02/10/2024 17:20, Catalin Marinas wrote: > On Mon, Sep 30, 2024 at 05:10:46PM +0100, Kristina Martsenko wrote: >> This series makes the memcpy(), memmove() and memset() routines use the >> CPY/SET instructions, as well as copy_page() and clear_page(). > > Another function we should optimise is mte_zero_clear_page_tags() using > SETG*. I can send that as a separate series. What about mte_set_mem_tag_range()? Thanks, Kristina
On Thu, Oct 03, 2024 at 05:49:57PM +0100, Kristina Martsenko wrote: > On 02/10/2024 17:20, Catalin Marinas wrote: > > On Mon, Sep 30, 2024 at 05:10:46PM +0100, Kristina Martsenko wrote: > >> This series makes the memcpy(), memmove() and memset() routines use the > >> CPY/SET instructions, as well as copy_page() and clear_page(). > > > > Another function we should optimise is mte_zero_clear_page_tags() using > > SETG*. > > I can send that as a separate series. Sounds good, thanks. > What about mte_set_mem_tag_range()? Ah, that as well but I guess only the init == true path since I don't think we have any FEAT_MOPS instruction for only setting the tags.
On Mon, 30 Sep 2024 17:10:46 +0100, Kristina Martsenko wrote: > Here is a small series to make memcpy() and related functions use the > memory copy/set instructions (Armv8.8 FEAT_MOPS). > > The kernel uses several library routines for copying or initializing > memory, for example copy_to_user() and memset(). These routines have > been optimized to make their load/store sequence perform well across a > range of CPUs. However the chosen sequence can't be the fastest possible > for every CPU microarchitecture nor for heterogeneous systems, and needs > to be rewritten periodically as hardware changes. > > [...] Applied to arm64 (for-next/mops), thanks! I left the documentation patch as is but it may be helpful to add a dedicated mops.txt one with some explanations around hypevisor requirements. Not urgent though. [1/5] arm64: probes: Disable kprobes/uprobes on MOPS instructions https://git.kernel.org/arm64/c/c56c599d9002 [2/5] arm64: mops: Handle MOPS exceptions from EL1 https://git.kernel.org/arm64/c/13840229d6bd [3/5] arm64: mops: Document booting requirement for HCR_EL2.MCE2 https://git.kernel.org/arm64/c/b616058c6613 [4/5] arm64: lib: Use MOPS for memcpy() routines https://git.kernel.org/arm64/c/836ed3c4e473 [5/5] arm64: lib: Use MOPS for copy_page() and clear_page() https://git.kernel.org/arm64/c/ce6b5ff5f16d