aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/tls.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-02-10 04:44:29 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:24 -0500
commitf355559cf78455ed6be103b020e4b800230c64eb (patch)
tree0de116766d38975f75178e299031d55967eaa9d7 /arch/um/sys-x86_64/tls.c
parent3a150e1da8bc4e840d5a09fc089052011b5b6503 (diff)
[PATCH] uml: x86_64 thread fixes
x86_64 needs some TLS fixes. What was missing was remembering the child thread id during clone and stuffing it into the child during each context switch. The %fs value is stored separately in the thread structure since the host controls what effect it has on the actual register file. The host also needs to store it in its own thread struct, so we need the value kept outside the register file. arch_prctl_skas was fixed to call PTRACE_ARCH_PRCTL appropriately. There is some saving and restoring of registers in the ARCH_SET_* cases so that the correct set of registers are changed on the host and restored to the process when it runs again. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/sys-x86_64/tls.c')
-rw-r--r--arch/um/sys-x86_64/tls.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/um/sys-x86_64/tls.c b/arch/um/sys-x86_64/tls.c
index ce1bf1b81c43..febbc94be25f 100644
--- a/arch/um/sys-x86_64/tls.c
+++ b/arch/um/sys-x86_64/tls.c
@@ -1,14 +1,17 @@
1#include "linux/sched.h" 1#include "linux/sched.h"
2 2
3void debug_arch_force_load_TLS(void)
4{
5}
6
7void clear_flushed_tls(struct task_struct *task) 3void clear_flushed_tls(struct task_struct *task)
8{ 4{
9} 5}
10 6
11int arch_copy_tls(struct task_struct *t) 7int arch_copy_tls(struct task_struct *t)
12{ 8{
9 /*
10 * If CLONE_SETTLS is set, we need to save the thread id
11 * (which is argument 5, child_tid, of clone) so it can be set
12 * during context switches.
13 */
14 t->thread.arch.fs = t->thread.regs.regs.skas.regs[R8 / sizeof(long)];
15
13 return 0; 16 return 0;
14} 17}