1. 20 5月, 2008 2 次提交
    • D
      sparc64: Add global register dumping facility. · 93dae5b7
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      93dae5b7
    • A
      sparc64: remove CVS keywords · b00dc837
      Adrian Bunk 提交于
      This patch removes the CVS keywords that weren't updated for a long time
      from comments.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b00dc837
  2. 17 5月, 2008 3 次提交
  3. 13 5月, 2008 2 次提交
  4. 12 5月, 2008 1 次提交
  5. 11 5月, 2008 2 次提交
    • D
      sparc: Fix debugger syscall restart interactions. · 28e61036
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      28e61036
    • D
      sparc: Fix ptrace() detach. · 986bef85
      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: NDavid S. Miller <davem@davemloft.net>
      986bef85
  6. 08 5月, 2008 2 次提交
    • D
      sparc: Fix SA_ONSTACK signal handling. · dc5dc7e6
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      dc5dc7e6
    • D
      sparc: Fix fork/clone/vfork system call restart. · 1e38c126
      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: NDavid S. Miller <davem@davemloft.net>
      1e38c126
  7. 07 5月, 2008 2 次提交
  8. 06 5月, 2008 2 次提交
  9. 04 5月, 2008 1 次提交
  10. 02 5月, 2008 2 次提交
    • D
      sparc64: Fix syscall restart, for real... · 2678fefe
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      2678fefe
    • D
      sparc64: Stop creating dummy root PCI host controller devices. · c26d3c01
      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: NDavid S. Miller <davem@davemloft.net>
      c26d3c01
  11. 29 4月, 2008 3 次提交
  12. 28 4月, 2008 4 次提交
  13. 27 4月, 2008 7 次提交
    • D
      sparc: Remove old style signal frame support. · 5526b7e4
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      5526b7e4
    • D
      sparc64: Kill bogus RT_ALIGNEDSZ macro from signal.c · 7cf06995
      David S. Miller 提交于
      The structure has to be 8-byte aligned in size, so
      this macro is just noise.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7cf06995
    • D
      sparc64: Kill unused local ISA bus layer. · 5da496e4
      David S. Miller 提交于
      No more drivers use this, and therefore it can die.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5da496e4
    • D
      sparc64: Do not ignore 'pmu' device ranges. · dc8ca2a1
      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: NDavid S. Miller <davem@davemloft.net>
      dc8ca2a1
    • D
      sparc64: Kill CONFIG_SPARC32_COMPAT · 09337f50
      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: NDavid S. Miller <davem@davemloft.net>
      09337f50
    • D
      sparc64: Cleanups and corrections for arch/sparc64/Kconfig · 05d515ef
      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: NDavid S. Miller <davem@davemloft.net>
      05d515ef
    • D
      sparc64: Fix wedged irq regression. · 227c3311
      David S. Miller 提交于
      Kernel bugzilla 10273
      
      As reported by Jos van der Ende, ever since commit
      5a606b72 ("[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: NDavid S. Miller <davem@davemloft.net>
      227c3311
  14. 25 4月, 2008 2 次提交
  15. 24 4月, 2008 5 次提交