summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2012-09-03 16:49:47 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 10:00:22 -0700
commitc68ef2b5cb50b54e7be25f53186ebf20220c6476 (patch)
treed373e4947db60eb93d0be7a022e60529c4b47d31
parent59d0622a07571c6344f0e3c71e7a1a71eb8db9e9 (diff)
downloadlinux-3.10-c68ef2b5cb50b54e7be25f53186ebf20220c6476.tar.gz
linux-3.10-c68ef2b5cb50b54e7be25f53186ebf20220c6476.tar.bz2
linux-3.10-c68ef2b5cb50b54e7be25f53186ebf20220c6476.zip
powerpc: Fix DSCR inheritance in copy_thread()
commit 1021cb268b3025573c4811f1dee4a11260c4507b upstream. If the default DSCR is non zero we set thread.dscr_inherit in copy_thread() meaning the new thread and all its children will ignore future updates to the default DSCR. This is not intended and is a change in behaviour that a number of our users have hit. We just need to inherit thread.dscr and thread.dscr_inherit from the parent which ends up being much simpler. This was found with the following test case: http://ozlabs.org/~anton/junkcode/dscr_default_test.c Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/powerpc/kernel/process.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 4937c969009..94178e55f49 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -799,16 +799,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
#endif /* CONFIG_PPC_STD_MMU_64 */
#ifdef CONFIG_PPC64
if (cpu_has_feature(CPU_FTR_DSCR)) {
- if (current->thread.dscr_inherit) {
- p->thread.dscr_inherit = 1;
- p->thread.dscr = current->thread.dscr;
- } else if (0 != dscr_default) {
- p->thread.dscr_inherit = 1;
- p->thread.dscr = dscr_default;
- } else {
- p->thread.dscr_inherit = 0;
- p->thread.dscr = 0;
- }
+ p->thread.dscr_inherit = current->thread.dscr_inherit;
+ p->thread.dscr = current->thread.dscr;
}
#endif