Commit graph

8 commits

Author SHA1 Message Date
Elliott Hughes
cb47a4f671 Use ifuncs for memset and memrchr.
Not useful right now, but Qualcomm has an Oryon memset they'd like to
use, and there's no reason to treat memrchr as a weird special case.

Bug: https://issuetracker.google.com/330105715
Test: treehugger
Change-Id: Id879479bf4f45433debcb3fe08cfa96bb1eb3b93
2024-03-26 18:58:50 +00:00
Elliott Hughes
3d8e98f8bd Add (no-op) ifuncs for SVE optimized routines.
This patch doesn't *enable* the SVE optimized routines, but it does let
us see if switching them to ifuncs will cause any app compat issues, so
that we can more easily use the optimized routines in future.

Test: treehugger
Change-Id: Ic5fe570bd21687da397b48127bf688f7ec68dd0c
2023-01-25 23:33:39 +00:00
Elliott Hughes
5ec0bfae50 Track upstream arm-optimized-routines changes.
The MTE-compatible routines are now faster than the incompatible ones,
so they merged them upstream.

I've left the ifunc boilerplate on the assumption that I'll be back
later to enable the new SVE variants.

Test: treehugger
Change-Id: Ic894bfb350b9aa70e307bca1c4978624b3e5f4fd
2023-01-25 18:12:18 +00:00
Elliott Hughes
7daf4596b7 Switch to the arm-optimized-routines memcpy() and memmove().
Outsource this to them, and choose the best of the two options available
based on the hardware we're running on.

Test: treehugger
Change-Id: I2fa7555c971b64a6decca132210e901ffa248efa
2022-11-17 00:38:49 +00:00
Tamas Petz
f5bdee7fdf libc: Add Armv8.3-A PAuth and Armv8.5-A BTI compatibility to *.S
The most notable change is in sigsetjmp/siglongjmp. The former
stores LR signed with the current SP into jmp_buf. Calling siglongjmp
reads a signed LR and the corresponding SP from jmp_buf. This way not
only the checksum provides some means of integrity protection but
Pointer Authentication too.

Test: Tested on FVP with BTI enabled.

Change-Id: I9d720239775f8d2829a677901f546c4b14b5cbe5
2020-09-04 11:29:12 +02:00
Peter Collingbourne
2361d4ef80 Adopt remaining MTE string routines.
ARM has released the remaining MTE string routines, so let's start
using them. The strnlen implementation is now compatible with MTE,
so it no longer needs to be an ifunc.

Bug: 135772972
Change-Id: I9de7fb44447aa1b878f4ad3f62cb0129857b43ad
2020-06-11 08:52:26 -07:00
Peter Collingbourne
337a5b3f9a Switch to the arm-optimized-routines string routines on aarch64 where possible.
This includes optimized strrchr and strchrnul routines, and an MTE-compatible
strlen routine.

Bug: 135772972
Change-Id: I48499f757cdc6d3e77e5649123d45b17dfa3c6b0
2020-02-25 13:11:55 -08:00
Peter Collingbourne
900d07d6a1 Add arm64 string.h function implementations for use with hardware supporting MTE.
As it turns out, our "generic" arm64 implementations of certain string.h
functions are not actually generic, since they will eagerly read memory
possibly outside of the bounds of an MTE granule, which may lead to a segfault
on MTE-enabled hardware. Therefore, move the implementations into a "default"
directory and use ifuncs to select between them and a new set of "mte"
implementations, conditional on whether the hardware and kernel support MTE.

The MTE implementations are currently naive implementations written in C
but will later be replaced with a set of optimized assembly implementations.

Bug: 135772972
Change-Id: Ife37c4e0e6fd60ff20a34594cc09c541af4d1dd7
2019-10-29 16:18:31 -07:00