12 Dec, 2011

1 commit


30 Oct, 2011

1 commit

  • For a ERESTARTNOHAND/ERESTARTSYS/ERESTARTNOINTR restarting system call
    do_signal will prepare the restart of the system call with a rewind of
    the PSW before calling get_signal_to_deliver (where the debugger might
    take control). For A ERESTART_RESTARTBLOCK restarting system call
    do_signal will set -EINTR as return code.
    There are two issues with this approach:
    1) strace never sees ERESTARTNOHAND, ERESTARTSYS, ERESTARTNOINTR or
    ERESTART_RESTARTBLOCK as the rewinding already took place or the
    return code has been changed to -EINTR
    2) if get_signal_to_deliver does not return with a signal to deliver
    the restart via the repeat of the svc instruction is left in place.
    This opens a race if another signal is made pending before the
    system call instruction can be reexecuted. The original system call
    will be restarted even if the second signal would have ended the
    system call with -EINTR.

    These two issues can be solved by dropping the early rewind of the
    system call before get_signal_to_deliver has been called and by using
    the TIF_RESTART_SVC magic to do the restart if no signal has to be
    delivered. The only situation where the system call restart via the
    repeat of the svc instruction is appropriate is when a SA_RESTART
    signal is delivered to user space.

    Unfortunately this breaks inferior calls by the debugger again. The
    system call number and the length of the system call instruction is
    lost over the inferior call and user space will see ERESTARTNOHAND/
    ERESTARTSYS/ERESTARTNOINTR/ERESTART_RESTARTBLOCK. To correct this a
    new ptrace interface is added to save/restore the system call number
    and system call instruction length.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

15 May, 2011

1 commit


17 May, 2010

1 commit

  • Copy the last breaking event address from the lowcore to a new
    field in the thread_struct on each system entry. Add a new
    ptrace request PTRACE_GET_LAST_BREAK and a new utrace regset
    REGSET_LAST_BREAK to query the last breaking event.

    This is useful for debugging wild branches in user space code.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

07 Mar, 2010

2 commits

  • The current ELF dumper implementation can produce broken corefiles if
    program headers exceed 65535. This number is determined by the number of
    vmas which the process have. In particular, some extreme programs may use
    more than 65535 vmas. (If you google max_map_count, you can find some
    users facing this problem.) This kind of program never be able to generate
    correct coredumps.

    This patch implements ``extended numbering'' that uses sh_info field of
    the first section header instead of e_phnum field in order to represent
    upto 4294967295 vmas.

    This is supported by
    AMD64-ABI(http://www.x86-64.org/documentation.html) and
    Solaris(http://docs.sun.com/app/docs/doc/817-1984/).
    Of course, we are preparing patches for gdb and binutils.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     
  • elf_core_dump() and elf_fdpic_core_dump() use #ifdef and the corresponding
    macro for hiding _multiline_ logics in functions. This patch removes
    #ifdef and replaces ELF_CORE_EXTRA_* by corresponding functions. For
    architectures not implemeonting ELF_CORE_EXTRA_*, we use weak functions in
    order to reduce a range of modification.

    This cleanup is for my next patches, but I think this cleanup itself is
    worth doing regardless of my firnal purpose.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     

01 Mar, 2010

1 commit

  • …/git/tip/linux-2.6-tip

    * 'x86-ptrace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, ptrace: Remove set_stopped_child_used_math() in [x]fpregs_set
    x86, ptrace: Simplify xstateregs_get()
    ptrace: Fix ptrace_regset() comments and diagnose errors specifically
    parisc: Disable CONFIG_HAVE_ARCH_TRACEHOOK
    ptrace: Add support for generic PTRACE_GETREGSET/PTRACE_SETREGSET
    x86, ptrace: regset extensions to support xstate

    Linus Torvalds
     

27 Feb, 2010

1 commit

  • S390 ELF core dump currently only contains the PSW, the general purpose
    registers, the floating point registers and the access registers stored
    in PRSTATUS/PRFPREG note sections.
    For analyzing s390 kernel problems additional registers are important.
    In order to be able to include these registers to a kernel ELF core dump,
    this patch adds the following five new note sections to elf.h:

    * NT_S390_TIMER: S390 timer register
    * NT_S390_TODCMP: S390 TOD comparator register
    * NT_S390_TODPREG: S390 TOD programmable register
    * NT_S390_CTRS: S390 control registers
    * NT_S390_PREFIX: S390 prefix register

    The new note sections have been already defined and accepted in the upstream
    binutils package.

    Signed-off-by: Michael Holzheu
    Signed-off-by: Martin Schwidefsky

    Michael Holzheu
     

12 Feb, 2010

2 commits

  • Generic support for PTRACE_GETREGSET/PTRACE_SETREGSET commands which
    export the regsets supported by each architecture using the correponding
    NT_* types. These NT_* types are already part of the userland ABI, used
    in representing the architecture specific register sets as different NOTES
    in an ELF core file.

    'addr' parameter for the ptrace system call encode the REGSET type (using
    the corresppnding NT_* type) and the 'data' parameter points to the
    struct iovec having the user buffer and the length of that buffer.

    struct iovec iov = { buf, len};
    ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);

    On successful completion, iov.len will be updated by the kernel specifying
    how much the kernel has written/read to/from the user's iov.buf.

    x86 extended state registers are primarily exported using this interface.

    Signed-off-by: Suresh Siddha
    LKML-Reference:
    Acked-by: Hongjiu Lu
    Cc: Roland McGrath
    Signed-off-by: H. Peter Anvin

    Suresh Siddha
     
  • Add the xstate regset support which helps extend the kernel ptrace and the
    core-dump interfaces to support AVX state etc.

    This regset interface is designed to support all the future state that gets
    supported using xsave/xrstor infrastructure.

    Looking at the memory layout saved by "xsave", one can't say which state
    is represented in the memory layout. This is because if a particular state is
    in init state, in the xsave hdr it can be represented by bit '0'. And hence
    we can't really say by the xsave header wether a state is in init state or
    the state is not saved in the memory layout.

    And hence the xsave memory layout available through this regset
    interface uses SW usable bytes [464..511] to convey what state is represented
    in the memory layout.

    First 8 bytes of the sw_usable_bytes[464..467] will be set to OS enabled xstate
    mask(which is same as the 64bit mask returned by the xgetbv's xCR0).

    The note NT_X86_XSTATE represents the extended state information in the
    core file, using the above mentioned memory layout.

    Signed-off-by: Suresh Siddha
    LKML-Reference:
    Signed-off-by: Hongjiu Lu
    Cc: Roland McGrath
    Signed-off-by: H. Peter Anvin

    Suresh Siddha
     

19 Dec, 2009

1 commit


06 Oct, 2009

1 commit


31 Jan, 2009

1 commit

  • fix the following 'make headers_check' warnings:

    usr/include/linux/elf.h:379: extern's make no sense in userspace
    usr/include/linux/elf.h:387: extern's make no sense in userspace
    usr/include/linux/elf.h:401: extern's make no sense in userspace
    usr/include/linux/elf.h:402: extern's make no sense in userspace

    Signed-off-by: Jaswinder Singh Rajput

    Jaswinder Singh Rajput
     

12 Oct, 2008

1 commit

  • This adds a user_regset type for the x86 io permissions bitmap.
    This makes it appear in core dumps (when ioperm has been used).
    It will also make it visible to debuggers in the future.

    Signed-off-by: Roland McGrath
    Signed-off-by: H. Peter Anvin
    [conflict resolutions: Signed-off-by: Ingo Molnar ]

    Roland McGrath
     

01 Jul, 2008

1 commit

  • This correctly hooks the VSX dump into Roland McGrath core file
    infrastructure. It adds the VSX dump information as an additional elf
    note in the core file (after talking more to the tool chain/gdb guys).
    This also ensures the formats are consistent between signals, ptrace
    and core files.

    Signed-off-by: Michael Neuling
    Signed-off-by: Paul Mackerras

    Michael Neuling
     

29 Apr, 2008

1 commit


08 Feb, 2008

2 commits

  • * 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (69 commits)
    [POWERPC] Add SPE registers to core dumps
    [POWERPC] Use regset code for compat PTRACE_*REGS* calls
    [POWERPC] Use generic compat_sys_ptrace
    [POWERPC] Use generic compat_ptrace_request
    [POWERPC] Use generic ptrace peekdata/pokedata
    [POWERPC] Use regset code for PTRACE_*REGS* requests
    [POWERPC] Switch to generic compat_binfmt_elf code
    [POWERPC] Switch to using user_regset-based core dumps
    [POWERPC] Add user_regset compat support
    [POWERPC] Add user_regset_view definitions
    [POWERPC] Use user_regset accessors for GPRs
    [POWERPC] ptrace accessors for special regs MSR and TRAP
    [POWERPC] Use user_regset accessors for SPE regs
    [POWERPC] Use user_regset accessors for altivec regs
    [POWERPC] Use user_regset accessors for FP regs
    [POWERPC] mpc52xx: fix compile error introduce when rebasing patch
    [POWERPC] 4xx: PCIe indirect DCR spinlock fix.
    [POWERPC] Add missing native dcr dcr_ind_lock spinlock
    [POWERPC] 4xx: Fix offset value on Warp board
    [POWERPC] 4xx: Add 440EPx Sequoia ehci dts entry
    ...

    Linus Torvalds
     
  • Do not export asm/elf.h during make headers_install.

    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

07 Feb, 2008

1 commit

  • This makes the SPE register data appear in ELF core dumps, using the
    new n_type value NT_PPC_SPE (0x101). This new note type is not used
    by any consumers of core files yet, but support can be added. I don't
    even have any hardware with SPE capabilities, so I've never seen such
    a note. But this demonstrates how simple it is to export register
    information in core dumps when the user_regset style is used for the
    low-level code.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     

30 Jan, 2008

1 commit

  • This makes ELF core dumps of 32-bit processes include a new
    note type NT_386_TLS (0x200) giving the contents of the TLS
    slots in struct user_desc format. This lets post mortem
    examination figure out what the segment registers mean like
    the debugger does with get_thread_area on a live process.

    Signed-off-by: Roland McGrath
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Roland McGrath
     

17 Oct, 2007

2 commits

  • include/asm-powerpc/elf.h has 6 entries in ARCH_DLINFO. fs/binfmt_elf.c
    has 14 unconditional NEW_AUX_ENT entries and 2 conditional NEW_AUX_ENT
    entries. So in the worst case, saved_auxv does not get an AT_NULL entry at
    the end.

    The saved_auxv array must be terminated with an AT_NULL entry. Make the
    size of mm_struct->saved_auxv arch dependend, based on the number of
    ARCH_DLINFO entries.

    Signed-off-by: Olaf Hering
    Cc: Roland McGrath
    Cc: Jakub Jelinek
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: "Luck, Tony"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     
  • Update dump_task_altivec() (which has so far never been put to use) so that
    it dumps the Altivec/VMX registers (VR[0] - VR[31], VSCR and VRSAVE) in the
    same format as the ptrace get_vrregs(), and add the appropriate glue
    typedef and #defines to make it work.

    A new note type of NT_PPC_VMX was chosen to be 0x100 (arbitrarily) because
    it allows the low range values to be used for more generic purposes and
    0x100 seems an adequate starting point for PowerPC extensions.

    Signed-off-by: Mark Nelson
    Signed-off-by: Paul Mackerras
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Andi Kleen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Nelson
     

19 Sep, 2007

1 commit

  • To start with, arch_notes_size() etc. is a little too ambiguous a name for
    my liking, so change the function names to be more explicit.

    Calling through macros is ugly, especially with hidden parameters, so don't
    do that, call the routines directly.

    Use ARCH_HAVE_EXTRA_ELF_NOTES as the only flag, and based on it decide
    whether we want the extern declarations or the empty versions.

    Since we have empty routines, actually use them in the coredump code to
    save a few #ifdefs.

    We want to change the handling of foffset so that the write routine updates
    foffset as it goes, instead of using file->f_pos (so that writing to a pipe
    works). So pass foffset to the write routine, and for now just set it to
    file->f_pos at the end of writing.

    It should also be possible for the write routine to fail, so change it to
    return int and treat a non-zero return as failure.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Jeremy Kerr
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

03 May, 2007

1 commit

  • Some versions of libc can't deal with a VDSO which doesn't have its
    ELF headers matching its mapped address. COMPAT_VDSO maps the VDSO at
    a specific system-wide fixed address. Previously this was all done at
    build time, on the grounds that the fixed VDSO address is always at
    the top of the address space. However, a hypervisor may reserve some
    of that address space, pushing the fixmap address down.

    This patch does the adjustment dynamically at runtime, depending on
    the runtime location of the VDSO fixmap.

    [ Patch has been through several hands: Jan Beulich wrote the orignal
    version; Zach reworked it, and Jeremy converted it to relocate phdrs
    as well as sections. ]

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Andi Kleen
    Cc: Zachary Amsden
    Cc: "Jan Beulich"
    Cc: Eric W. Biederman
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Roland McGrath

    Jeremy Fitzhardinge
     

08 Dec, 2006

2 commits

  • In file included from include/asm/patch.h:14,
    from arch/ia64/kernel/patch.c:10:
    include/linux/elf.h:375: warning: "struct file" declared inside parameter list
    include/linux/elf.h:375: warning: its scope is only this definition or declaration, which is probably not what you want

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Define elf_addr_t in linux/elf.h. The size of the type is determined using
    ELF_CLASS. This allows us to remove the defines that today are spread all
    over .c and .h files.

    Signed-off-by: Magnus Damm
    Cc: Daniel Jacobowitz
    Cc: Roland McGrath
    Cc: Jakub Jelinek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     

04 Dec, 2006

1 commit

  • This patch adds SPU elf notes to the coredump. It creates a separate note
    for each of /regs, /fpcr, /lslr, /decr, /decr_status, /mem, /signal1,
    /signal1_type, /signal2, /signal2_type, /event_mask, /event_status,
    /mbox_info, /ibox_info, /wbox_info, /dma_info, /proxydma_info, /object-id.

    A new macro, ARCH_HAVE_EXTRA_NOTES, was created for architectures to
    specify they have extra elf core notes.

    A new macro, ELF_CORE_EXTRA_NOTES_SIZE, was created so the size of the
    additional notes could be calculated and added to the notes phdr entry.

    A new macro, ELF_CORE_WRITE_EXTRA_NOTES, was created so the new notes
    would be written after the existing notes.

    The SPU coredump code resides in spufs. Stub functions are provided in the
    kernel which are hooked into the spufs code which does the actual work via
    register_arch_coredump_calls().

    A new set of __spufs__read/get() functions was provided to allow the
    coredump code to read from the spufs files without having to lock the
    SPU context for each file read from.

    Cc:
    Signed-off-by: Dwayne Grant McConnell
    Signed-off-by: Arnd Bergmann

    Dwayne Grant McConnell
     

27 Apr, 2006

1 commit


09 Jan, 2006

1 commit


08 Sep, 2005

1 commit

  • The size of auxiliary vector is fixed at 42 in linux/sched.h. But it isn't
    very obvious when looking at linux/elf.h. This patch adds AT_VECTOR_SIZE
    so that we can change it if necessary when a new vector is added.

    Because of include file ordering problems, doing this necessitated the
    extraction of the AT_* symbols into a standalone header file.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H. J. Lu
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds