diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-02-10 01:44:30 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 10:51:24 -0800 |
commit | 6e6d74cfac782a3a4cb5111bd9c25cd95d6b7c6c (patch) | |
tree | f63c0433740168f56916ece27793e9b69a40e072 /arch/um/sys-x86_64/syscalls.c | |
parent | f355559cf78455ed6be103b020e4b800230c64eb (diff) |
[PATCH] uml: x86_64 ptrace fixes
This patch fixes some missing ptrace bits on x86_64. PTRACE_ARCH_PRCTL is
hooked up and implemented. This required generalizing arch_prctl_skas
slightly to take a task_struct to modify. Previously, it always operated on
current.
Reading and writing the debug registers is also enabled by un-ifdefing the
code that implements that. It turns out that x86_64 is identical to i386, so
the same code can be used.
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/syscalls.c')
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index f309fa9bc232..01b91f9fa789 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c @@ -59,18 +59,20 @@ static long arch_prctl_tt(int code, unsigned long addr) #ifdef CONFIG_MODE_SKAS -static long arch_prctl_skas(int code, unsigned long __user *addr) +long arch_prctl_skas(struct task_struct *task, int code, + unsigned long __user *addr) { unsigned long *ptr = addr, tmp; long ret; - int pid = current->mm->context.skas.id.u.pid; + int pid = task->mm->context.skas.id.u.pid; /* * With ARCH_SET_FS (and ARCH_SET_GS is treated similarly to * be safe), we need to call arch_prctl on the host because * setting %fs may result in something else happening (like a - * GDT being set instead). So, we let the host fiddle the - * registers and restore them afterwards. + * GDT or thread.fs being set instead). So, we let the host + * fiddle the registers and thread struct and restore the + * registers afterwards. * * So, the saved registers are stored to the process (this * needed because a stub may have been the last thing to run), @@ -118,7 +120,7 @@ static long arch_prctl_skas(int code, unsigned long __user *addr) long sys_arch_prctl(int code, unsigned long addr) { - return CHOOSE_MODE_PROC(arch_prctl_tt, arch_prctl_skas, code, + return CHOOSE_MODE_PROC(arch_prctl_tt, arch_prctl_skas, current, code, (unsigned long __user *) addr); } @@ -141,6 +143,6 @@ void arch_switch_to_skas(struct task_struct *from, struct task_struct *to) if(to->thread.arch.fs == 0) return; - arch_prctl_skas(ARCH_SET_FS, (void __user *) to->thread.arch.fs); + arch_prctl_skas(to, ARCH_SET_FS, (void __user *) to->thread.arch.fs); } |