aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-08-03 20:13:05 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-08 00:32:35 +1000
commit2679f63fe5e4bb1459a0c20859a99c70c15d5ea1 (patch)
tree19a843ace4fd633800529e9f44e77d583f7fd464 /tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
parentselftests/powerpc/64: Test all paths through copy routines (diff)
downloadlinux-dev-2679f63fe5e4bb1459a0c20859a99c70c15d5ea1.tar.xz
linux-dev-2679f63fe5e4bb1459a0c20859a99c70c15d5ea1.zip
selftests/powerpc/64: Test exception cases in copy_tofrom_user
This adds a set of test cases to test the behaviour of copy_tofrom_user when exceptions are encountered accessing the source or destination. Currently, copy_tofrom_user does not always copy as many bytes as possible when an exception occurs on a store to the destination, and that is reflected in failures in these tests. Based on a test program from Anton Blanchard. [paulus@ozlabs.org - test all three paths, wrote commit description, made EX_TABLE create an exception table.] Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h')
-rw-r--r--tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h27
1 files changed, 8 insertions, 19 deletions
diff --git a/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h b/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
index 91bc40392eb3..0605df807593 100644
--- a/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
+++ b/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __SELFTESTS_POWERPC_PPC_ASM_H
+#define __SELFTESTS_POWERPC_PPC_ASM_H
#include <ppc-asm.h>
#define CONFIG_ALTIVEC
@@ -26,25 +28,10 @@
#define PPC_MTOCRF(A, B) mtocrf A, B
-#define EX_TABLE(x, y)
-
-FUNC_START(enter_vmx_usercopy)
- li r3,1
- blr
-
-FUNC_START(exit_vmx_usercopy)
- li r3,0
- blr
-
-FUNC_START(enter_vmx_ops)
- li r3,1
- blr
-
-FUNC_START(exit_vmx_ops)
- blr
-
-FUNC_START(__copy_tofrom_user_base)
- blr
+#define EX_TABLE(x, y) \
+ .section __ex_table,"a"; \
+ .8byte x, y; \
+ .previous
#define BEGIN_FTR_SECTION .if test_feature
#define FTR_SECTION_ELSE .else
@@ -56,3 +43,5 @@ FUNC_START(__copy_tofrom_user_base)
/* Default to taking the first of any alternative feature sections */
test_feature = 1
+
+#endif /* __SELFTESTS_POWERPC_PPC_ASM_H */