mbox series

[v2,0/3] Import Arm Optimized Routines str{n}cmp functions

Message ID 20220301101435.19327-1-joey.gouly@arm.com (mailing list archive)
Headers show
Series Import Arm Optimized Routines str{n}cmp functions | expand

Message

Joey Gouly March 1, 2022, 10:14 a.m. UTC
Hi all,

The previous str{n}cmp routines were not MTE safe, so were disabled in:
  59a68d413808 ("arm64: Mitigate MTE issues with str{n}cmp()")

The Arm Optimized Routines repository recently merged [1] their strcmp.S and
strcmp-mte.S files into a single file that is MTE safe.

Therefore we can import these new MTE safe functions and remove the workaround.

I did some light boot tests using QEMU.

Changes since v1 [2]:
  - Rebased onto v5.17-rc3 (Asked for by Will [3])
  - Clarified the license in the commit message
  - Added Mark's acks

Thanks,
Joey

[1] https://github.com/ARM-software/optimized-routines/commit/7b91c3cdb12b023004cb4dda30a1aa3424329ce6
[2] https://lore.kernel.org/linux-arm-kernel/20220215170723.21266-1-joey.gouly@arm.com/
[3] https://lore.kernel.org/linux-arm-kernel/20220225142144.GC19698@willie-the-truck/

Joey Gouly (3):
  arm64: lib:  Import latest version of Arm Optimized Routines' strcmp
  arm64: lib:  Import latest version of Arm Optimized Routines' strncmp
  Revert "arm64: Mitigate MTE issues with str{n}cmp()"

 arch/arm64/include/asm/assembler.h |   5 -
 arch/arm64/include/asm/string.h    |   2 -
 arch/arm64/lib/strcmp.S            | 240 +++++++++++++++--------------
 arch/arm64/lib/strncmp.S           | 236 +++++++++++++++++-----------
 4 files changed, 269 insertions(+), 214 deletions(-)

Comments

Catalin Marinas March 1, 2022, 3:02 p.m. UTC | #1
On Tue, Mar 01, 2022 at 10:14:32AM +0000, Joey Gouly wrote:
> The previous str{n}cmp routines were not MTE safe, so were disabled in:
>   59a68d413808 ("arm64: Mitigate MTE issues with str{n}cmp()")
> 
> The Arm Optimized Routines repository recently merged [1] their strcmp.S and
> strcmp-mte.S files into a single file that is MTE safe.
> 
> Therefore we can import these new MTE safe functions and remove the workaround.
> 
> I did some light boot tests using QEMU.
> 
> Changes since v1 [2]:
>   - Rebased onto v5.17-rc3 (Asked for by Will [3])
>   - Clarified the license in the commit message
>   - Added Mark's acks

For the series:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Will Deacon March 7, 2022, 10:03 p.m. UTC | #2
On Tue, 1 Mar 2022 10:14:32 +0000, Joey Gouly wrote:
> The previous str{n}cmp routines were not MTE safe, so were disabled in:
>   59a68d413808 ("arm64: Mitigate MTE issues with str{n}cmp()")
> 
> The Arm Optimized Routines repository recently merged [1] their strcmp.S and
> strcmp-mte.S files into a single file that is MTE safe.
> 
> Therefore we can import these new MTE safe functions and remove the workaround.
> 
> [...]

Applied to arm64 (for-next/strings), thanks!

[1/3] arm64: lib: Import latest version of Arm Optimized Routines' strcmp
      https://git.kernel.org/arm64/c/507f788d05e7
[2/3] arm64: lib: Import latest version of Arm Optimized Routines' strncmp
      https://git.kernel.org/arm64/c/387d828adffc
[3/3] Revert "arm64: Mitigate MTE issues with str{n}cmp()"
      https://git.kernel.org/arm64/c/e33c89256e66

Cheers,