22 May, 2008

3 commits


20 May, 2008

3 commits

  • When a cpu really is stuck in the kernel, it can be often
    impossible to figure out which cpu is stuck where. The
    worst case is when the stuck cpu has interrupts disabled.

    Therefore, implement a global cpu state capture that uses
    SMP message interrupts which are not disabled by the
    normal IRQ enable/disable APIs of the kernel.

    As long as we can get a sysrq 'y' to the kernel, we can
    get a dump. Even if the console interrupt cpu is wedged,
    we can trigger it from userspace using /proc/sysrq-trigger

    The output is made compact so that this facility is more
    useful on high cpu count systems, which is where this
    facility will likely find itself the most useful :)

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This patch removes the CVS keywords that weren't updated for a long time
    from comments.

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    [PATCH] return to old errno choice in mkdir() et.al.
    [Patch] fs/binfmt_elf.c: fix wrong return values
    [PATCH] get rid of leak in compat_execve()
    [Patch] fs/binfmt_elf.c: fix a wrong free
    [PATCH] avoid multiplication overflows and signedness issues for max_fds
    [PATCH] dup_fd() part 4 - race fix
    [PATCH] dup_fd() - part 3
    [PATCH] dup_fd() part 2
    [PATCH] dup_fd() fixes, part 1
    [PATCH] take init_files to fs/file.c

    Linus Torvalds
     

17 May, 2008

3 commits


13 May, 2008

2 commits


12 May, 2008

1 commit

  • Read all of the OF memory and translation tables, then read
    the physical available memory list twice.

    When making these requests, OF can allocate more memory to
    do it's job, which can remove pages from the available
    memory list.

    So fetch in all of the tables at once, and fetch the available
    list last to make sure we read a stable value.

    Signed-off-by: David S. Miller

    David S. Miller
     

11 May, 2008

2 commits

  • So, forever, we've had this ptrace_signal_deliver implementation
    which tries to handle all of the nasties that can occur when the
    debugger looks at a process about to take a signal. It's meant
    to address all of these issues inside of the kernel so that the
    debugger need not be mindful of such things.

    Problem is, this doesn't work.

    The idea was that we should do the syscall restart business first, so
    that the debugger captures that state. Otherwise, if the debugger for
    example saves the child's state, makes the child execute something
    else, then restores the saved state, we won't handle the syscall
    restart properly because we lose the "we're in a syscall" state.

    The code here worked for most cases, but if the debugger actually
    passes the signal through to the child unaltered, it's possible that
    we would do a syscall restart when we shouldn't have.

    In particular this breaks the case of debugging a process under a gdb
    which is being debugged by yet another gdb. gdb uses sigsuspend
    to wait for SIGCHLD of the inferior, but if gdb itself is being
    debugged by a top-level gdb we get a ptrace_stop(). The top-level gdb
    does a PTRACE_CONT with SIGCHLD to let the inferior gdb see the
    signal. But ptrace_signal_deliver() assumed the debugger would cancel
    out the signal and therefore did a syscall restart, because the return
    error was ERESTARTNOHAND.

    Fix this by simply making ptrace_signal_deliver() a nop, and providing
    a way for the debugger to control system call restarting properly:

    1) Report a "in syscall" software bit in regs->{tstate,psr}.
    It is set early on in trap entry to a system call and is fully
    visible to the debugger via ptrace() and regsets.

    2) Test this bit right before doing a syscall restart. We have
    to do a final recheck right after get_signal_to_deliver() in
    case the debugger cleared the bit during ptrace_stop().

    3) Clear the bit in trap return so we don't accidently try to set
    that bit in the real register.

    As a result we also get a ptrace_{is,clear}_syscall() for sparc32 just
    like sparc64 has.

    M68K has this same exact bug, and is now the only other user of the
    ptrace_signal_deliver hook. It needs to be fixed in the same exact
    way as sparc.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Forever we had a PTRACE_SUNOS_DETACH which was unconditionally
    recognized, regardless of the personality of the process.

    Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h
    header file on sparc as PTRACE_DETACH and PT_DETACH.

    So continue to recognize this old value. Luckily, it doesn't conflict
    with anything we actually care about.

    Signed-off-by: David S. Miller

    David S. Miller
     

08 May, 2008

2 commits

  • We need to be more liberal about the alignment of the buffer given to
    us by sigaltstack(). The user should not need to be mindful of all of
    the alignment constraints we have for the stack frame.

    This mirrors how we handle this situation in clone() as well.

    Also, we align the stack even in non-SA_ONSTACK cases so that signals
    due to bad stack alignment can be delivered properly. This makes such
    errors easier to debug and recover from.

    Finally, add the sanity check x86 has to make sure we won't overflow
    the signal stack.

    This fixes glibc testcases nptl/tst-cancel20.c and
    nptl/tst-cancelx20.c

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We clobber %i1 as well as %i0 for these system calls,
    because they give two return values.

    Therefore, on error, we have to restore %i1 properly
    or else the restart explodes since it uses the wrong
    arguments.

    This fixes glibc's nptl/tst-eintr1.c testcase.

    Signed-off-by: David S. Miller

    David S. Miller
     

07 May, 2008

2 commits


06 May, 2008

2 commits


04 May, 2008

1 commit


02 May, 2008

2 commits

  • The change I put into copy_thread() just papered over the real
    problem.

    When we are looking to see if we should do a syscall restart, when
    deliverying a signal, we should only interpret the syscall return
    value as an error if the carry condition code(s) are set.

    Otherwise it's a success return.

    Also, sigreturn paths should do a pt_regs_clear_trap_type().

    It turns out that doing a syscall restart when returning from a fork()
    does and should happen, from time to time. Even if copy_thread()
    returns success, copy_process() can still unwind and signal
    -ERESTARTNOINTR in the parent.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • It just creates confusion, errors, and bugs.

    For one thing, this can cause dup sysfs or procfs nodes to get
    created:

    [ 1.198015] proc_dir_entry '00.0' already registered
    [ 1.198036] Call Trace:
    [ 1.198052] [00000000004f2534] create_proc_entry+0x7c/0x98
    [ 1.198092] [00000000005719e4] pci_proc_attach_device+0xa4/0xd4
    [ 1.198126] [00000000007d991c] pci_proc_init+0x64/0x88
    [ 1.198158] [00000000007c62a4] kernel_init+0x190/0x330
    [ 1.198183] [0000000000426cf8] kernel_thread+0x38/0x48
    [ 1.198210] [00000000006a0d90] rest_init+0x18/0x5c

    Signed-off-by: David S. Miller

    David S. Miller
     

30 Apr, 2008

1 commit


29 Apr, 2008

2 commits

  • Remove dulicated include file in arch/sparc64/kernel/smp.c.

    Signed-off-by: Huang Weiyi
    Signed-off-by: David S. Miller

    Huang Weiyi
     
  • Current limitations:

    1) On SMP single stepping has some fundamental issues,
    shared with other sw single-step architectures such
    as mips and arm.

    2) On 32-bit sparc we don't support SMP kgdb yet. That
    requires some reworking of the IPI mechanisms and
    infrastructure on that platform.

    Signed-off-by: David S. Miller

    David S. Miller
     

28 Apr, 2008

3 commits


27 Apr, 2008

7 commits

  • Back around the same time we were bootstrapping the first 32-bit sparc
    Linux kernel with a SunOS userland, we made the signal frame match
    that of SunOS.

    By the time we even started putting together a native Linux userland
    for 32-bit Sparc we realized this layout wasn't sufficient for Linux's
    needs.

    Therefore we changed the layout, yet kept support for the old style
    signal frame layout in there. The detection mechanism is that we had
    sys_sigaction() start passing in a negative signal number to indicate
    "new style signal frames please".

    Anyways, no binaries exist in the world that use the old stuff. In
    fact, I bet Jakub Jelinek and myself are the only two people who ever
    had such binaries to be honest.

    So let's get rid of this stuff.

    I added an assertion using WARN_ON_ONCE() that makes sure 32-bit
    applications are passing in that negative signal number still.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The structure has to be 8-byte aligned in size, so
    this macro is just noise.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • No more drivers use this, and therefore it can die.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • I must have disabled this due to other bugs which were fixed over
    time. And this is needed in order for child devices of "pmu"
    to get proper resource values.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • It's completely superfluous, CONFIG_COMPAT is sufficient.

    What this used to be is an umbrella for enabling code shared
    by all 32-bit compat binary support types. But with the
    removal of SunOS and Solaris support, the only one left is
    Linux 32-bit ELF.

    Update defconfig.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Refer to chip as "SPARC" throughout.

    Say 32-bit SPARC and 64-bit SPARC rather than mentioning specific
    chips such like UltraSPARC, as appropriate.

    Remove non-sense help text referring to things that will never appear
    on a SPARC system, such as EISA busses etc.

    Use "help" instead of "--help--"

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Kernel bugzilla 10273

    As reported by Jos van der Ende, ever since commit
    5a606b72a4309a656cd1a19ad137dc5557c4b8ea ("[SPARC64]: Do not ACK an
    INO if it is disabled or inprogress.") sun4u interrupts
    can get stuck.

    What this changset did was add the following conditional to
    the various IRQ chip ->enable() handlers on sparc64:

    if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
    return;

    which is correct, however it means that special care is needed
    in the ->enable() method.

    Specifically we must put the interrupt into IDLE state during
    an enable, or else it might never be sent out again.

    Setting the INO interrupt state to IDLE resets the state machine,
    the interrupt input to the INO is retested by the hardware, and
    if an interrupt is being signalled by the device, the INO
    moves back into TRANSMIT state, and an interrupt vector is sent
    to the cpu.

    The two sun4v IRQ chip handlers were already doing this properly,
    only sun4u got it wrong.

    Signed-off-by: David S. Miller

    David S. Miller
     

25 Apr, 2008

2 commits


24 Apr, 2008

2 commits