1. 27 9月, 2006 1 次提交
  2. 26 9月, 2006 8 次提交
    • J
      [PATCH] uml: stack usage reduction · 75e29b18
      Jeff Dike 提交于
      The KSTK_* macros used an inordinate amount of stack.  In order to overcome
      an impedance mismatch between their interface, which just returns a single
      register value, and the interface of get_thread_regs, which took a full
      pt_regs, the implementation created an on-stack pt_regs, filled it in, and
      returned one field.  do_task_stat calls KSTK_* twice, resulting in two
      local pt_regs, blowing out the stack.
      
      This patch changes the interface (and name) of get_thread_regs to just
      return a single register from a jmp_buf.
      
      The include of archsetjmp.h" in registers.h to get the definition of
      jmp_buf exposed a bogus include of <setjmp.h> in start_up.c.  <setjmp.h>
      shouldn't be used anywhere any more since UML uses the klibc
      setjmp/longjmp.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      75e29b18
    • J
      [PATCH] uml: Remove unused variable · 602cc241
      Jeff Dike 提交于
      timer_irq_inited was useless, so it is removed.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      602cc241
    • 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: SIGIO cleanups · 19bdf040
      Jeff Dike 提交于
      - Various cleanups in the sigio code.
      
      - Removed explicit zero-initializations of a few structures.
      
      - Improved some error messages.
      
      - An API change - there was an asymmetry between reactivate_fd calling
        maybe_sigio_broken, which goes through all the machinery of figuring out if
        a file descriptor supports SIGIO and applying the workaround to it if not,
        and deactivate_fd, which just turns off the descriptor.
      
        This is changed so that only activate_fd calls maybe_sigio_broken, when
        the descriptor is first seen.  reactivate_fd now calls add_sigio_fd, which
        is symmetric with ignore_sigio_fd.
      
        This removes a recursion which makes a critical section look more critical
        than it really was, obsoleting a big comment to that effect.  This requires
        keeping track of all descriptors which are getting the SIGIO treatment, not
        just the ones being polled at any given moment, so that reactivate_fd,
        through add_sigio_fd, doesn't try to tell the SIGIO thread about descriptors
        it doesn't care about.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      19bdf040
    • J
      [PATCH] uml: Fix handling of failed execs of helpers · 6b7aaad9
      Jeff Dike 提交于
      There were some bugs in handling failures to exec helper programs.  errno was
      passed back from the child with the wrong sign.  It was also ignored.  In the
      case where it mattered, the errno from the (successful) read in the parent was
      used instead.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6b7aaad9
    • J
      [PATCH] uml: Use ARRAY_SIZE more assiduously · 91b165c0
      Jeff Dike 提交于
      There were a bunch of missed ARRAY_SIZE opportunities.
      
      Also, some formatting fixes in the affected areas of code.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      91b165c0
    • 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
  3. 15 7月, 2006 1 次提交
  4. 11 7月, 2006 9 次提交
  5. 02 7月, 2006 2 次提交
    • P
      [PATCH] uml: rename and improve actually_do_remove() · eb28931e
      Paolo 'Blaisorblade' Giarrusso 提交于
      Rename actually_do_remove() to remove_files_and_dir(), make it call
      closedir(), make it ignore ENOENT (I see it frequently enough).
      
      ENOENT is probably due to multiple threads calling the exitcall functions
      together*, but fixing that is non-trivial; and ignoring it is perfectly ok
      in any case.
      
      * it can surely happen: last_ditch_exit() is installed as SIGTERM handler
        at boot, and it's not removed on thread creation.  So killall vmlinux
        (which I do) surely causes that.  I've seen also a crash which seems to
        do the same.
      
      Installing the handler on only the main thread would make UML do no cleanup
      when another thread exits, and we're not sure we want that.  And mutual
      exclusion in that context is tricky - we can't use spinlock in code not on
      a kernel stack (spinlock debugging uses "current" a lot).
      Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      eb28931e
    • P
      [PATCH] uml: fix not_dead_yet when directory is in bad state · 912ad922
      Paolo 'Blaisorblade' Giarrusso 提交于
      The bug occurred to me when a UML left an empty ~/.uml/Sarge-norm folder -
      when trying to reuse not_dead_yet() failed one of its check.  The comment
      says that's ok and means that we can take the directory, but while normally
      not_dead_yet() removes it and returns 0 (i.e.  go on, use this), on failure
      it returns 0 but forgets to remove it.  The fix is to remove it anytime
      we're going to return 0.
      
      But since "not_dead_yet" didn't make the interface so clear, causing this
      bug, and I couldn't find a convenient name for the mix of things it did, I
      split it into two parts:
      
      is_umdir_used()      -	returns a boolean, contains all checks of not_dead_yet()
      umdir_take_if_dead   -	tries to remove the dir unless it's used - returns
      			whether it removed it, that is we now own it.
      
      With this changes the control flow is IMHO a bit clearer and needs less
      comment for control flow.
      Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      912ad922
  6. 01 7月, 2006 2 次提交
  7. 06 6月, 2006 2 次提交
  8. 02 5月, 2006 5 次提交
  9. 20 4月, 2006 3 次提交
  10. 11 4月, 2006 7 次提交