]> git.baikalelectronics.ru Git - kernel.git/commit
x32: Add ptrace for x32
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 5 Mar 2012 23:32:11 +0000 (15:32 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 5 Mar 2012 23:43:45 +0000 (15:43 -0800)
commit324e3a214b9f0b8744ba011d39c9d927f9a8c72a
treee20a2212d4de9d91c4b986a2a8dba5197516213e
parent856d6daf6782010eef4b3feb09b1100fb7075aa8
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
arch/x86/kernel/ptrace.c
arch/x86/syscalls/syscall_64.tbl