mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Some archs -- arm64 and s390x -- implemented chacha using instructions that are available most places, but aren't always available. The kernel handles this just fine, but the selftest does not. Check the hwcaps before running, and skip the test if the cpu doesn't support it. As well, on s390x, always emit the fallback instructions of an alternative block, to ensure maximum compatibility. Co-developed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
19 lines
353 B
C
19 lines
353 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TOOLS_ASM_ALTERNATIVE_ASM_H
|
|
#define _TOOLS_ASM_ALTERNATIVE_ASM_H
|
|
|
|
#if defined(__s390x__)
|
|
#ifdef __ASSEMBLY__
|
|
.macro ALTERNATIVE oldinstr, newinstr, feature
|
|
\oldinstr
|
|
.endm
|
|
#endif
|
|
#else
|
|
|
|
/* Just disable it so we can build arch/x86/lib/memcpy_64.S for perf bench: */
|
|
|
|
#define ALTERNATIVE #
|
|
|
|
#endif
|
|
|
|
#endif
|