Commit 2504e5b9 authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Michael Ellerman
Browse files

selftests/powerpc/copyloops: Add memmove_64 test



While debugging an issue, we wanted to check whether the arch specific
kernel memmove implementation is correct.
This selftest could help test that.

Suggested-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Suggested-by: default avatarVaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/57242c1fe7aba6b7f0fcd0490303bfd5f222ee00.1631512686.git.riteshh@linux.ibm.com
parent 92e6dc25
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,3 +13,4 @@ copyuser_64_exc_t0
copyuser_64_exc_t1
copyuser_64_exc_t2
copy_mc_64
memmove_64
+8 −1
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@ TEST_GEN_PROGS := copyuser_64_t0 copyuser_64_t1 copyuser_64_t2 \
		copyuser_p7_t0 copyuser_p7_t1 \
		memcpy_64_t0 memcpy_64_t1 memcpy_64_t2 \
		memcpy_p7_t0 memcpy_p7_t1 copy_mc_64 \
		copyuser_64_exc_t0 copyuser_64_exc_t1 copyuser_64_exc_t2
		copyuser_64_exc_t0 copyuser_64_exc_t1 copyuser_64_exc_t2 \
		memmove_64

EXTRA_SOURCES := validate.c ../harness.c stubs.S

@@ -56,3 +57,9 @@ $(OUTPUT)/copyuser_64_exc_t%: copyuser_64.S exc_validate.c ../harness.c \
		-D COPY_LOOP=test___copy_tofrom_user_base \
		-D SELFTEST_CASE=$(subst copyuser_64_exc_t,,$(notdir $@)) \
		-o $@ $^

$(OUTPUT)/memmove_64: mem_64.S memcpy_64.S memmove_validate.c ../harness.c \
		memcpy_stubs.S
	$(CC) $(CPPFLAGS) $(CFLAGS) \
		-D TEST_MEMMOVE=test_memmove \
		-o $@ $^
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#define _GLOBAL(A) FUNC_START(test_ ## A)
#define _GLOBAL_TOC(A) _GLOBAL(A)
#define _GLOBAL_TOC_KASAN(A) _GLOBAL(A)
#define _GLOBAL_KASAN(A) _GLOBAL(A)

#define PPC_MTOCRF(A, B)	mtocrf A, B

+1 −0
Original line number Diff line number Diff line
../../../../../arch/powerpc/lib/mem_64.S
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#include <asm/ppc_asm.h>

FUNC_START(memcpy)
	b test_memcpy

FUNC_START(backwards_memcpy)
	b test_backwards_memcpy
Loading