summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-03-19 16:12:50 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-03-23 12:49:27 -0700
commita0518e0445325892f9a92fbd19cbfdb0eecfdb3e (patch)
tree2a4f02ec4fbafe043dc4791ce44a505df25468b5 /include
parent7ac7551d5cf0d01b0a67a6653c25045e23904732 (diff)
UML - arch_prctl should set thread fs
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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-um/processor-x86_64.h6
-rw-r--r--include/asm-um/ptrace-x86_64.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index 10609af376c0..578ca0492cbe 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -13,6 +13,7 @@
struct arch_thread {
unsigned long debugregs[8];
int debugregs_seq;
+ unsigned long fs;
struct faultinfo faultinfo;
};
@@ -25,8 +26,9 @@ extern inline void rep_nop(void)
#define cpu_relax() rep_nop()
#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
- .debugregs_seq = 0, \
- .faultinfo = { 0, 0, 0 } }
+ .debugregs_seq = 0, \
+ .fs = 0, \
+ .faultinfo = { 0, 0, 0 } }
static inline void arch_flush_thread(struct arch_thread *thread)
{
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index 03b4af4ac09a..a927450ce401 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -81,9 +81,7 @@ static inline void arch_switch_to_tt(struct task_struct *from,
{
}
-static inline void arch_switch_to_skas(struct task_struct *from,
- struct task_struct *to)
-{
-}
+extern void arch_switch_to_skas(struct task_struct *from,
+ struct task_struct *to);
#endif