1. 25 7月, 2008 1 次提交
  2. 17 7月, 2008 2 次提交
    • R
      x86 ptrace: user-sets-TF nits · 380fdd75
      Roland McGrath 提交于
      This closes some arcane holes in single-step handling that can arise
      only when user programs set TF directly (via popf or sigreturn) and
      then use vDSO (syscall/sysenter) system call entry.  In those entry
      paths, the clear_TF_reenable case hits and we must check TIF_SINGLESTEP
      to be sure our bookkeeping stays correct wrt the user's view of TF.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      380fdd75
    • R
      x86 ptrace: unify syscall tracing · d4d67150
      Roland McGrath 提交于
      This unifies and cleans up the syscall tracing code on i386 and x86_64.
      
      Using a single function for entry and exit tracing on 32-bit made the
      do_syscall_trace() into some terrible spaghetti.  The logic is clear and
      simple using separate syscall_trace_enter() and syscall_trace_leave()
      functions as on 64-bit.
      
      The unification adds PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support
      on x86_64, for 32-bit ptrace() callers and for 64-bit ptrace() callers
      tracing either 32-bit or 64-bit tasks.  It behaves just like 32-bit.
      
      Changing syscall_trace_enter() to return the syscall number shortens
      all the assembly paths, while adding the SYSEMU feature in a simple way.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      d4d67150
  3. 01 7月, 2008 1 次提交
  4. 14 5月, 2008 1 次提交
  5. 13 5月, 2008 1 次提交
    • M
      x86, ptrace: PEBS support · 93fa7636
      Markus Metzger 提交于
      Polish the ds.h interface and add support for PEBS.
      
      Ds.c is meant to be the resource allocator for per-thread and per-cpu
      BTS and PEBS recording.
      It is used by ptrace/utrace to provide execution tracing of debugged tasks.
      It will be used by profilers (e.g. perfmon2).
      It may be used by kernel debuggers to provide a kernel execution trace.
      
      Changes in detail:
      - guard DS and ptrace by CONFIG macros
      - separate DS and BTS more clearly
      - simplify field accesses
      - add functions to manage PEBS buffers
      - add simple protection/allocation mechanism
      - added support for Atom
      
      Opens:
      - buffer overflow handling
        Currently, only circular buffers are supported. This is all we need
        for debugging. Profilers would want an overflow notification.
        This is planned to be added when perfmon2 is made to use the ds.h
        interface.
      - utrace intermediate layer
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      93fa7636
  6. 26 4月, 2008 2 次提交
  7. 17 4月, 2008 1 次提交
  8. 27 3月, 2008 1 次提交
    • A
      x86: ptrace.c: fix defined-but-unused warnings · d8d4f157
      Andrew Morton 提交于
      arch/x86/kernel/ptrace.c:548: warning: 'ptrace_bts_get_size' defined but not used
      arch/x86/kernel/ptrace.c:558: warning: 'ptrace_bts_read_record' defined but not used
      arch/x86/kernel/ptrace.c:607: warning: 'ptrace_bts_clear' defined but not used
      arch/x86/kernel/ptrace.c:617: warning: 'ptrace_bts_drain' defined but not used
      arch/x86/kernel/ptrace.c:720: warning: 'ptrace_bts_config' defined but not used
      arch/x86/kernel/ptrace.c:788: warning: 'ptrace_bts_status' defined but not used
      
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      d8d4f157
  9. 12 3月, 2008 1 次提交
    • R
      x86: ia32 syscall restart fix · 40f0933d
      Roland McGrath 提交于
      The code to restart syscalls after signals depends on checking for a
      negative orig_ax, and for particular negative -ERESTART* values in ax.
      These fields are 64 bits and for a 32-bit task they get zero-extended.
      The syscall restart behavior is lost, a regression from a native 32-bit
      kernel and from 64-bit tasks' behavior.
      
      This patch fixes the problem by doing sign-extension where it matters.
      
      For orig_ax, the only time the value should be -1 but winds up as
      0x0ffffffff is via a 32-bit ptrace call. So the patch changes ptrace to
      sign-extend the 32-bit orig_eax value when it's stored; it doesn't
      change the checks on orig_ax, though it uses the new current_syscall()
      inline to better document the subtle importance of the used of
      signedness there.
      
      The ax value is stored a lot of ways and it seems hard to get them all
      sign-extended at their origins. So for that, we use the
      current_syscall_ret() to sign-extend it only for 32-bit tasks at the
      time of the -ERESTART* comparisons.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      40f0933d
  10. 08 3月, 2008 1 次提交
    • R
      x86_64: make ptrace always sign-extend orig_ax to 64 bits · 84c6f604
      Roland McGrath 提交于
      This makes 64-bit ptrace calls setting the 64-bit orig_ax field for a
      32-bit task sign-extend the low 32 bits up to 64.  This matches what a
      64-bit debugger expects when tracing a 32-bit task.
      
      This follows on my "x86_64 ia32 syscall restart fix".  This didn't
      matter until that was fixed.
      
      The debugger ignores or zeros the high half of every register slot it
      sets (including the orig_rax pseudo-register) uniformly.  It expects
      that the setting of the low 32 bits always has the same meaning as a
      32-bit debugger setting those same 32 bits with native 32-bit
      facilities.
      
      This never arose before because the syscall restart check never
      matched any -ERESTART* values due to lack of sign extension.  Before
      that fix, even 32-bit ptrace setting orig_eax to -1 failed to trigger
      the restart check anyway.  So this was never noticed as a regression
      of 64-bit debuggers vs 32-bit debuggers on the same 64-bit kernel.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      [ Changed to just do the sign-extension unconditionally on x86-64,
        since orig_ax is always just a small integer and doesn't need
        the full 64-bit range ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      84c6f604
  11. 01 3月, 2008 1 次提交
  12. 22 2月, 2008 1 次提交
  13. 07 2月, 2008 1 次提交
  14. 30 1月, 2008 25 次提交