diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-03-05 18:32:11 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-03-05 18:43:45 -0500 |
commit | 55283e2537714f9370c4ab847d170acf223daf90 (patch) | |
tree | e20a2212d4de9d91c4b986a2a8dba5197516213e /arch/x86/syscalls | |
parent | e7084fd52ed71249ab2ce7a7d89d601c9d1f904c (diff) |
x32: Add ptrace for x32
X32 ptrace is a hybrid of 64bit ptrace and compat ptrace with 32bit
address and longs. It use 64bit ptrace to access the full 64bit
registers. PTRACE_PEEKUSR and PTRACE_POKEUSR are only allowed to access
segment and debug registers. PTRACE_PEEKUSR returns the lower 32bits
and PTRACE_POKEUSR zero-extends 32bit value to 64bit. It works since
the upper 32bits of segment and debug registers of x32 process are always
zero. GDB only uses PTRACE_PEEKUSR and PTRACE_POKEUSR to access
segment and debug registers.
[ hpa: changed TIF_X32 test to use !is_ia32_task() instead, and moved
the system call number to the now-unused 521 slot. ]
Signed-off-by: "H.J. Lu" <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/1329696488-16970-1-git-send-email-hpa@zytor.com
Diffstat (limited to 'arch/x86/syscalls')
-rw-r--r-- | arch/x86/syscalls/syscall_64.tbl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl index 0d778b800884..dd29a9ea27c5 100644 --- a/arch/x86/syscalls/syscall_64.tbl +++ b/arch/x86/syscalls/syscall_64.tbl | |||
@@ -107,7 +107,7 @@ | |||
107 | 98 common getrusage sys_getrusage | 107 | 98 common getrusage sys_getrusage |
108 | 99 common sysinfo sys_sysinfo | 108 | 99 common sysinfo sys_sysinfo |
109 | 100 common times sys_times | 109 | 100 common times sys_times |
110 | 101 common ptrace sys_ptrace | 110 | 101 64 ptrace sys_ptrace |
111 | 102 common getuid sys_getuid | 111 | 102 common getuid sys_getuid |
112 | 103 common syslog sys_syslog | 112 | 103 common syslog sys_syslog |
113 | 104 common getgid sys_getgid | 113 | 104 common getgid sys_getgid |
@@ -331,7 +331,7 @@ | |||
331 | 518 x32 sendmsg compat_sys_sendmsg | 331 | 518 x32 sendmsg compat_sys_sendmsg |
332 | 519 x32 recvmsg compat_sys_recvmsg | 332 | 519 x32 recvmsg compat_sys_recvmsg |
333 | 520 x32 execve stub_x32_execve | 333 | 520 x32 execve stub_x32_execve |
334 | # 521 available | 334 | 521 x32 ptrace compat_sys_ptrace |
335 | 522 x32 rt_sigpending sys32_rt_sigpending | 335 | 522 x32 rt_sigpending sys32_rt_sigpending |
336 | 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait | 336 | 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait |
337 | 524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo | 337 | 524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo |