diff options
author | Anton Blanchard <anton@samba.org> | 2015-12-09 04:11:47 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-12-10 05:11:13 -0500 |
commit | db1231dcdb4dc6cdcbdef0babe641a9162c0dc98 (patch) | |
tree | 34250a59e15b1d3e9620a7a9e3083b0a4fa82bce /tools | |
parent | 20dbe67062062c2a790832f0d30e73dba45df7c4 (diff) |
powerpc: Fix DSCR inheritance over fork()
Two DSCR tests have a hack in them:
/*
* XXX: Force a context switch out so that DSCR
* current value is copied into the thread struct
* which is required for the child to inherit the
* changed value.
*/
sleep(1);
We should not be working around this in the testcase, it is a kernel bug.
Fix it by copying the current DSCR to the child, instead of what we
had in the thread struct at last context switch.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c | 8 | ||||
-rw-r--r-- | tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c | 8 |
2 files changed, 0 insertions, 16 deletions
diff --git a/tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c b/tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c index 8265504de571..08a8b95e3bc1 100644 --- a/tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c +++ b/tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c | |||
@@ -60,14 +60,6 @@ int dscr_inherit_exec(void) | |||
60 | else | 60 | else |
61 | set_dscr(dscr); | 61 | set_dscr(dscr); |
62 | 62 | ||
63 | /* | ||
64 | * XXX: Force a context switch out so that DSCR | ||
65 | * current value is copied into the thread struct | ||
66 | * which is required for the child to inherit the | ||
67 | * changed value. | ||
68 | */ | ||
69 | sleep(1); | ||
70 | |||
71 | pid = fork(); | 63 | pid = fork(); |
72 | if (pid == -1) { | 64 | if (pid == -1) { |
73 | perror("fork() failed"); | 65 | perror("fork() failed"); |
diff --git a/tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c b/tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c index 4e414caf7f40..3e5a6d195e9a 100644 --- a/tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c +++ b/tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c | |||
@@ -40,14 +40,6 @@ int dscr_inherit(void) | |||
40 | else | 40 | else |
41 | set_dscr(dscr); | 41 | set_dscr(dscr); |
42 | 42 | ||
43 | /* | ||
44 | * XXX: Force a context switch out so that DSCR | ||
45 | * current value is copied into the thread struct | ||
46 | * which is required for the child to inherit the | ||
47 | * changed value. | ||
48 | */ | ||
49 | sleep(1); | ||
50 | |||
51 | pid = fork(); | 43 | pid = fork(); |
52 | if (pid == -1) { | 44 | if (pid == -1) { |
53 | perror("fork() failed"); | 45 | perror("fork() failed"); |