selftests/powerpc: Test unaligned copy and paste
A message that is not in the archive (sent off-list or not yet received): e37b8e320e55954bfaa36593197a2fa35db109cf.1466119782.git.chris@distroguy.com
PATCH v2 2/2 selftests/powerpc: Test unaligned copy and paste
Test that an ISA 3.0 compliant machine performing an unaligned copy, copy_first, paste or paste_last is sent a SIGBUS.
---
Changes since v1:
- check that the instruction we trapped on was the one we want
- split out tests into common code
tools/testing/selftests/powerpc/Makefile | 3 +- .../testing/selftests/powerpc/alignment/.gitignore | 5 ++ tools/testing/selftests/powerpc/alignment/Makefile | 11 ++++ .../powerpc/alignment/copy_first_unaligned.c | 41 +++++++++++++ .../alignment/copy_paste_unaligned_common.c | 53 +++++++++++++++++ .../alignment/copy_paste_unaligned_common.h | 26 +++++++++ .../selftests/powerpc/alignment/copy_unaligned.c | 41 +++++++++++++ .../powerpc/alignment/paste_last_unaligned.c | 43 ++++++++++++++ .../selftests/powerpc/alignment/paste_unaligned.c | 43 ++++++++++++++ tools/testing/selftests/powerpc/instructions.h | 68 ++++++++++++++++++++++ 10 files changed, 333 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/powerpc/alignment/.gitignore create mode 100644 tools/testing/selftests/powerpc/alignment/Makefile create mode 100644 tools/testing/selftests/powerpc/alignment/copy_first_unaligned.c create mode 100644 tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.c create mode 100644 tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h create mode 100644 tools/testing/selftests/powerpc/alignment/copy_unaligned.c create mode 100644 tools/testing/selftests/powerpc/alignment/paste_last_unaligned.c create mode 100644 tools/testing/selftests/powerpc/alignment/paste_unaligned.c create mode 100644 tools/testing/selftests/powerpc/instructions.h
tools/testing/selftests/powerpc/Makefile +0 -0
@@ -12,7 +12,8 @@ CFLAGS := -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $
export CFLAGS
-SUB_DIRS = benchmarks \
+SUB_DIRS = alignment \
+ benchmarks \ copyloops \ context_switch \ dscr \
tools/testing/selftests/powerpc/alignment/.gitignore new file +5 -0
@@ -0,0 +1,5 @@ +copy_unaligned +copy_first_unaligned +paste_unaligned +paste_last_unaligned +copy_paste_unaligned_common
tools/testing/selftests/powerpc/alignment/Makefile new file +11 -0
@@ -0,0 +1,11 @@ +TEST_PROGS := copy_unaligned copy_first_unaligned paste_unaligned paste_last_unaligned + +all: $(TEST_PROGS) + +$(TEST_PROGS): ../harness.c ../utils.c copy_paste_unaligned_common.c + +include ../../lib.mk + +clean: + rm -f $(TEST_PROGS) +
tools/testing/selftests/powerpc/alignment/copy_first_unaligned.c new file +41 -0
41 lines not on this page · raw message
tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.c new file +53 -0
53 lines not on this page · raw message
tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright 2016, Chris Smart, IBM Corporation. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version +* 2 of the License, or (at your option) any later version. +* +* Declarations for common code for copy, copy_first, paste and +* paste_last unaligned tests. +* +*/ + +#ifndef _SELFTESTS_POWERPC_COPY_PASTE_H +#define _SELFTESTS_POWERPC_COPY_PASTE_H + +#include <signal.h> + +int main (int argc,char *argv[]); +void signal_action_handler (int signal_num,siginfo_t *info,void *ptr); +void setup_signal_handler (void ); +extern char cacheline_buf[128] __cacheline_aligned; +extern unsigned int expected_instruction; +extern unsigned int instruction_mask; + +#endif /* _SELFTESTS_POWERPC_COPY_PASTE_H */
tools/testing/selftests/powerpc/alignment/copy_unaligned.c new file +41 -0
41 lines not on this page · raw message
tools/testing/selftests/powerpc/alignment/paste_last_unaligned.c new file +43 -0
43 lines not on this page · raw message
tools/testing/selftests/powerpc/alignment/paste_unaligned.c new file +43 -0
43 lines not on this page · raw message
tools/testing/selftests/powerpc/instructions.h new file +68 -0
68 lines not on this page · raw message
Signature · 1 line
2.7.4
Quoted 4 lines · Chris Smart
Test that an ISA 3.0 compliant machine performing an unaligned copy,
copy_first, paste orpaste_lastis sent a SIGBUS.Signed-off-by Chris Smart <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/4375088072295b09cc5d9bf7a8
cheers