1. 18 12月, 2007 1 次提交
    • S
      uml: stop gdb from deleting breakpoints when running UML · 4dbed85a
      Stanislaw Gruszka 提交于
      Sometimes when UML is debugged gdb miss breakpoints.
      
      When process traced by gdb do fork, debugger remove breakpoints from
      child address space. There is possibility to trace more than one fork,
      but this not work with UML, I guess (only guess) there is a deadlock -
      gdb waits for UML and UML waits for gdb.
      
      When clone() is called with SIGCHLD and CLONE_VM flags, gdb see this
      as PTRACE_EVENT_FORK not as PTRACE_EVENT_CLONE and remove breakpoints
      from child and at the same time from traced process, because either
      have the same address space.
      
      Maybe it is possible to do fix in gdb, but I'm not sure if there is
      easy way to find out if traced and child processes share memory. So I
      do fix for UML, it simply do not call clone() with both SIGCHLD and
      CLONE_VM flags together.  Additionally __WALL flag is used for
      waitpid() to assure not miss clone and normal process events.
      
      [ jdike - checkpatch fixes ]
      Signed-off-by: NStanislaw Gruszka <stf_xl@wp.pl>
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4dbed85a
  2. 17 10月, 2007 13 次提交
  3. 17 7月, 2007 1 次提交
    • J
      uml: SIGIO support cleanup · 42a359e3
      Jeff Dike 提交于
      Cleanup of the SIGWINCH support.
      
      Some code and comment reformatting.
      
      The stack used for SIGWINCH threads was leaked.  This is now fixed by storing
      it with the pid and other information, and freeing it when the thread is
      killed.
      
      If something goes wrong with a WIGWINCH thread, and this is discovered in the
      interrupt handler, the winch record would leak.  It is now freed, except that
      the IRQ isn't freed.  This is hard to do from interrupt context.  This has the
      side-effect that the IRQ system maintains a reference to the freed structure,
      but that shouldn't cause a problem since the descriptor is disabled.
      
      register_winch_irq is now much better about cleaning up after an
      initialization failure.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42a359e3
  4. 17 6月, 2007 1 次提交
  5. 11 5月, 2007 2 次提交
  6. 10 5月, 2007 1 次提交
  7. 08 5月, 2007 7 次提交
  8. 28 3月, 2007 1 次提交
    • J
      [PATCH] uml: use correct register file size everywhere · b92c4f92
      Jeff Dike 提交于
      This patch uses MAX_REG_NR consistently to refer to the register file size.
       FRAME_SIZE isn't sufficient because on x86_64, it is smaller than the
      ptrace register file size.  MAX_REG_NR was introduced as a consistent way
      to get the number of registers, but wasn't used everywhere it should be.
      
      When this causes a problem, it makes PTRACE_SETREGS fail on x86_64 because
      of a corrupted segment register value in the known-good register file.  The
      patch also adds a register dump at that point in case there are any future
      problems here.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b92c4f92
  9. 07 3月, 2007 1 次提交
  10. 04 11月, 2006 1 次提交
    • J
      [PATCH] uml: include tidying · 1f6f6164
      Jeff Dike 提交于
      In order to get the __NR_* constants, we need sys/syscall.h.
      linux/unistd.h works as well since it includes syscall.h, however syscall.h
      is more parsimonious.  We were inconsistent in this, and this patch adds
      syscall.h includes where necessary and removes linux/unistd.h includes
      where they are not needed.
      
      asm/unistd.h also includes the __NR_* constants, but these are not the
      glibc-sanctioned ones, so this also removes one such inclusion.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1f6f6164
  11. 27 9月, 2006 1 次提交
    • J
      [PATCH] uml: thread creation tidying · 3c917350
      Jeff Dike 提交于
      fork on UML has always somewhat subtle.  The underlying cause has been the
      need to initialize a stack for the new process.  The only portable way to
      initialize a new stack is to set it as the alternate signal stack and take a
      signal.  The signal handler does whatever initialization is needed and jumps
      back to the original stack, where the fork processing is finished.  The basic
      context switching mechanism is a jmp_buf for each process.  You switch to a
      new process by longjmping to its jmp_buf.
      
      Now that UML has its own implementation of setjmp and longjmp, and I can poke
      around inside a jmp_buf without fear that libc will change the structure, a
      much simpler mechanism is possible.  The jmpbuf can simply be initialized by
      hand.
      
      This eliminates -
      	the need to set up and remove the alternate signal stack
      	sending and handling a signal
      	the signal blocking needed around the stack switching, since
      there is no stack switching
      	setting up the jmp_buf needed to jump back to the original
      stack after the new one is set up
      
      In addition, since jmp_buf is now defined by UML, and not by libc, it can be
      embedded in the thread struct.  This makes it unnecessary to have it exist on
      the stack, where it used to be.  It also simplifies interfaces, since the
      switch jmp_buf used to be a void * inside the thread struct, and functions
      which took it as an argument needed to define a jmp_buf variable and assign it
      from the void *.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3c917350
  12. 26 9月, 2006 3 次提交
    • J
      [PATCH] uml: timer cleanups · 537ae946
      Jeff Dike 提交于
      set_interval returns an error instead of panicing if setitimer fails.  Some of
      its callers now check the return.
      
      enable_timer is largely tt-mode-specific, so it is marked as such, and the
      only skas-mode caller is made to call set-interval instead.
      
      user_time_init was a no-value-added wrapper around set_interval, so it is
      gone.
      
      Since set_interval is now called from kernel code, callers no longer pass
      ITIMER_* to it.  Instead, they pass a flag which is converted into ITIMER_REAL
      or ITIMER_VIRTUAL.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      537ae946
    • J
      [PATCH] uml: Move signal handlers to arch code · 4b84c69b
      Jeff Dike 提交于
      Have most signals go through an arch-provided handler which recovers the
      sigcontext and then calls a generic handler.  This replaces the
      ARCH_GET_SIGCONTEXT macro, which was somewhat fragile.  On x86_64, recovering
      %rdx (which holds the sigcontext pointer) must be the first thing that
      happens.  sig_handler duly invokes that first, but there is no guarantee that
      I can see that instructions won't be reordered such that %rdx is used before
      that.  Having the arch provide the handler seems much more robust.
      
      Some signals in some parts of UML require their own handlers - these places
      don't call set_handler any more.  They call sigaction or signal themselves.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4b84c69b
    • J
      [PATCH] uml: Use klibc setjmp/longjmp · 13c06be3
      Jeff Dike 提交于
      This patch adds an implementation of setjmp and longjmp to UML, allowing
      access to the inside of a jmpbuf without needing the access macros formerly
      provided by libc.
      
      The implementation is stolen from klibc.  I copy the relevant files into
      arch/um.  I have another patch which avoids the copying, but requires klibc be
      in the tree.
      
      setjmp and longjmp users required some tweaking.  Includes of <setjmp.h> were
      removed and includes of the UML longjmp.h were added where necessary.  There
      are also replacements of siglongjmp with UML_LONGJMP which I somehow missed
      earlier.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      13c06be3
  13. 15 7月, 2006 1 次提交
  14. 11 7月, 2006 1 次提交
  15. 02 5月, 2006 1 次提交
  16. 20 4月, 2006 1 次提交
  17. 11 4月, 2006 1 次提交
  18. 08 2月, 2006 1 次提交
  19. 19 1月, 2006 1 次提交
    • J
      [PATCH] uml: implement soft interrupts · 1d7173ba
      Jeff Dike 提交于
      This patch implements soft interrupts.  Interrupt enabling and disabling no
      longer map to sigprocmask.  Rather, a flag is set indicating whether
      interrupts may be handled.  If a signal comes in and interrupts are marked as
      OK, then it is handled normally.  If interrupts are marked as off, then the
      signal handler simply returns after noting that a signal needs handling.  When
      interrupts are enabled later on, this pending signals flag is checked, and the
      IRQ handlers are called at that point.
      
      The point of this is to reduce the cost of local_irq_save et al, since they
      are very much more common than the signals that they are enabling and
      disabling.  Soft interrupts produce a speed-up of ~25% on a kernel build.
      
      Subtleties -
      
          UML uses sigsetjmp/siglongjmp to switch contexts.  sigsetjmp has been
          wrapped in a save_flags-like macro which remembers the interrupt state at
          setjmp time, and restores it when it is longjmp-ed back to.
      
          The enable_signals function has to loop because the IRQ handler
          disables interrupts before returning.  enable_signals has to return with
          signals enabled, and signals may come in between the disabling and the
          return to enable_signals.  So, it loops for as long as there are pending
          signals, ensuring that signals are enabled when it finally returns, and
          that there are no pending signals that need to be dealt with.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1d7173ba