1. 17 10月, 2007 12 次提交
    • J
      uml: tickless support · d2753a6d
      Jeff Dike 提交于
      Enable tickless support.
      
      CONFIG_TICK_ONESHOT and CONFIG_NO_HZ are enabled.
      
      itimer_clockevent gets CLOCK_EVT_FEAT_ONESHOT and an implementation of
      .set_next_event.
      
      CONFIG_UML_REAL_TIME_CLOCK goes away because it only makes sense when there is
      a clock ticking away all the time.  timer_handler now just calls do_IRQ once
      without trying to figure out how many ticks to emulate.
      
      The idle loop now needs to turn ticking on and off.
      
      Userspace ticks keep happening as usual.  However, the userspace loop keep
      track of when the next wakeup should happen and suppresses process ticks until
      that happens.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2753a6d
    • J
      uml: separate timer initialization · 78a26e25
      Jeff Dike 提交于
      Move timer signal initialization from init_irq_signals to a new function,
      timer_init.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      78a26e25
    • J
      uml: simplify interval setting · a2f018bf
      Jeff Dike 提交于
      set_interval took a timer type as an argument, but it always specified a
      virtual timer.  So, it is not needed, and it is gone, and set_interval is
      simplified appropriately.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2f018bf
    • J
      uml: fix timer switching · 181bde80
      Jeff Dike 提交于
      Fix up the switching between virtual and real timers.  The idle loop sleeps,
      so the timer at that point must be real time.  At all other times, the timer
      must be virtual.  Even when userspace is running, and the kernel is asleep,
      the virtual timer is correct because the process timer will be running and the
      process timer will be firing.
      
      The timer switch used to be in the context switch and timer handler code.
      This is moved to the idle loop and the signal handler, making it much more
      clear why it is happening.
      
      switch_timers now returns the old timer type so that it may be restored.  The
      signal handler uses this in order to restore the previous timer type when it
      returns.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      181bde80
    • J
      uml: userspace files should call libc directly · 512b6fb1
      Jeff Dike 提交于
      A number of files that were changed in the recent removal of tt mode
      are userspace files which call the os_* wrappers instead of calling
      libc directly.  A few other files were affected by this, through
      
      This patch makes these call glibc directly.
      
      There are also style fixes in the affected areas.
      
      os_print_error has no remaining callers, so it is deleted.
      
      There is a interface change to os_set_exec_close, eliminating a
      parameter which was always the same.  The callers are fixed as well.
      
      os_process_pc got its error path cleaned up.
      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>
      512b6fb1
    • J
      uml: remove os_* usage from userspace files · 8ca842c4
      Jeff Dike 提交于
      This patch fixes some userspace files which were calling libc through the os_*
      wrappers.
      
      It turns out that there was only one user of os_new_tty_pgrp, so it can be
      deleted.
      
      There are also some style and whitespace fixes in here.
      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>
      8ca842c4
    • J
      uml: get rid of do_longjmp · fab95c55
      Jeff Dike 提交于
      do_longjmp used to be needed when UML didn't have its own implementation of
      setjmp and longjmp.  They came from libc, and couldn't be called directly from
      kernel code, as the libc jmp_buf couldn't be imported there.  do_longjmp was a
      userspace function which served to provide longjmp access to kernel code.
      
      This is gone, and a number of void * pointers can now be jmp_buf *.
      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>
      fab95c55
    • J
      uml: style fixes pass 3 · ba180fd4
      Jeff Dike 提交于
      Formatting changes in the files which have been changed in the course
      of folding foo_skas functions into their callers.  These include:
      	copyright updates
      	header file trimming
      	style fixes
      	adding severity to printks
      
      These changes should be entirely non-functional.
      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>
      ba180fd4
    • J
      uml: remove code made redundant by CHOOSE_MODE removal · 77bf4400
      Jeff Dike 提交于
      This patch makes a number of simplifications enabled by the removal of
      CHOOSE_MODE.  There were lots of functions that looked like
      
      	int foo(args){
      		foo_skas(args);
      	}
      
      The bodies of foo_skas are now folded into foo, and their declarations (and
      sometimes entire header files) are deleted.
      
      In addition, the union uml_pt_regs, which was a union between the tt and skas
      register formats, is now a struct, with the tt-mode arm of the union being
      removed.
      
      It turns out that usr2_handler was unused, so it is gone.
      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>
      77bf4400
    • J
      uml: throw out CONFIG_MODE_TT · 42fda663
      Jeff Dike 提交于
      This patchset throws out tt mode, which has been non-functional for a while.
      
      This is done in phases, interspersed with code cleanups on the affected files.
      
      The removal is done as follows:
      	remove all code, config options, and files which depend on
      CONFIG_MODE_TT
      	get rid of the CHOOSE_MODE macro, which decided whether to
      call tt-mode or skas-mode code, and replace invocations with their
      skas portions
      	replace all now-trivial procedures with their skas equivalents
      
      There are now a bunch of now-redundant pieces of data structures, including
      mode-specific pieces of the thread structure, pt_regs, and mm_context.  These
      are all replaced with their skas-specific contents.
      
      As part of the ongoing style compliance project, I made a style pass over all
      files that were changed.  There are three such patches, one for each phase,
      covering the files affected by that phase but no later ones.
      
      I noticed that we weren't freeing the LDT state associated with a process when
      it exited, so that's fixed in one of the later patches.
      
      The last patch is a tidying patch which I've had for a while, but which caused
      inexplicable crashes under tt mode.  Since that is no longer a problem, this
      can now go in.
      
      This patch:
      
      Start getting rid of tt mode support.
      
      This patch throws out CONFIG_MODE_TT and all config options, code, and files
      which depend on it.
      
      CONFIG_MODE_SKAS is gone and everything that depends on it is included
      unconditionally.
      
      The few changed lines are in re-written Kconfig help, lines which needed
      something skas-related removed from them, and a few more which weren't
      strictly deletions.
      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>
      42fda663
    • J
      uml: stop saving process FP state · 42daba31
      Jeff Dike 提交于
      Throw out a lot of code dealing with saving and restoring floating-point
      state.  In skas mode, where processes run in a restoring floating-point state
      on kernel entry and exit is pointless.
      
      This eliminates most of arch/um/os-Linux/sys-{i386,x86_64}/registers.c.  Most
      of what remained is now arch-indpendent, and can be moved up to
      arch/um/os-Linux/registers.c.  Both arches need the jmp_buf accessor
      get_thread_reg, and i386 needs {save,restore}_fp_regs because it cheats during
      sigreturn by getting the fp state using ptrace rather than copying it out of
      the process sigcontext.
      
      After this, it turns out that arch/um/include/skas/mode-skas.h is almost
      completely unneeded.  The declarations in it are variables which either don't
      exist or which don't have global scope.  The one exception is
      kill_off_processes_skas.  If that's removed, this header can be deleted.
      
      This uncovered a bug in user.h, which wasn't correctly making sure that a
      size_t definition was available to both userspace and kernelspace files.
      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>
      42daba31
    • J
      uml: tidy recently-moved code · 8e2d10e1
      Jeff Dike 提交于
      Now that the generic console operations are in a userspace file, we
      can do the following:
      	directly call into libc instead of through the os_* wrappers
      	eliminate os_window_size since it has only one user
      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>
      8e2d10e1
  2. 17 7月, 2007 1 次提交
  3. 11 5月, 2007 1 次提交
  4. 08 5月, 2007 7 次提交
    • J
      uml: more page fault path trimming · 16dd07bc
      Jeff Dike 提交于
      More trimming of the page fault path.
      
      Permissions are passed around in a single int rather than one bit per
      int.  The permission values are copied from libc so that they can be
      passed to mmap and mprotect without any further conversion.
      
      The register sets used by do_syscall_stub and copy_context_skas0 are
      initialized once, at boot time, rather than once per call.
      
      wait_stub_done checks whether it is getting the signals it expects by
      comparing the wait status to a mask containing bits for the signals of
      interest rather than comparing individually to the signal numbers.  It
      also has one check for a wait failure instead of two.  The caller is
      expected to do the initial continue of the stub.  This gets rid of an
      argument and some logic.  The fname argument is gone, as that can be
      had from a stack trace.
      
      user_signal() is collapsed into userspace() as it is basically one or
      two lines of code afterwards.
      
      The physical memory remapping stuff is gone, as it is unused.
      
      flush_tlb_page is inlined.
      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>
      16dd07bc
    • J
      uml: speed page fault path · 64f60841
      Jeff Dike 提交于
      Give the page fault code a specialized path.  There is only one page to look
      at, so there's no point in going into the general page table walking code.
      There's only going to be one host operation, so there are no opportunities for
      merging.  So, we go straight to the pte we want, figure out what needs doing,
      and do it.
      
      While I was in here, I fixed the wart where the address passed to unmap was a
      void *, but an unsigned long to map and protect.
      
      This gives me just under 10% on a kernel build.
      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>
      64f60841
    • J
      uml: rename os_{read_write}_file_k back to os_{read_write}_file · a6ea4cce
      Jeff Dike 提交于
      Rename os_{read_write}_file_k back to os_{read_write}_file, delete
      the originals and their bogus infrastructure, and fix all the callers.
      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>
      a6ea4cce
    • J
      uml: dump core on panic · 63843c26
      Jeff Dike 提交于
      Dump core after a panic.  This will provide better debugging information than
      is currently available.
      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>
      63843c26
    • J
      uml: start fixing os_read_file and os_write_file · 3d564047
      Jeff Dike 提交于
      This patch starts the removal of a very old, very broken piece of code.  This
      stems from the problem of passing a userspace buffer into read() or write() on
      the host.  If that buffer had not yet been faulted in, read and write will
      return -EFAULT.
      
      To avoid this problem, the solution was to fault the buffer in before the
      system call by touching the pages that hold the buffer by doing a copy-user of
      a byte to each page.  This is obviously bogus, but it does usually work, in tt
      mode, since the kernel and process are in the same address space and userspace
      addresses can be accessed directly in the kernel.
      
      In skas mode, where the kernel and process are in separate address spaces, it
      is completely bogus because the userspace address, which is invalid in the
      kernel, is passed into the system call instead of the corresponding physical
      address, which would be valid.  Here, it appears that this code, on every host
      read() or write(), tries to fault in a random process page.  This doesn't seem
      to cause any correctness problems, but there is a performance impact.  This
      patch, and the ones following, result in a 10-15% performance gain on a kernel
      build.
      
      This code can't be immediately tossed out because when it is, you can't log
      in.  Apparently, there is some code in the console driver which depends on
      this somehow.
      
      However, we can start removing it by switching the code which does I/O using
      kernel addresses to using plain read() and write().  This patch introduces
      os_read_file_k and os_write_file_k for use with kernel buffers and converts
      all call locations which use obvious kernel buffers to use them.  These
      include I/O using buffers which are local variables which are on the stack or
      kmalloc-ed.  Later patches will handle the less obvious cases, followed by a
      mass conversion back to the original interface.
      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>
      3d564047
    • J
      uml: move remaining useful contents of user_util.h · 24fa6c08
      Jeff Dike 提交于
      Rescue the useful contents of the soon-to-be-gone user-util.h.
      
      pty.c now gets ptsname from stdlib.h like it should have always done.
      
      CATCH_EINTR is now in os.h, although perhaps all usage should be under
      os-Linux at some point.
      
      get_pty is also in os.h.
      
      This patch restores the old definition of ARRAY_SIZE in user.h.  This file is
      included only in userspace files, so there will be no conflict with the
      kernel's new ARRAY_SIZE.  The copy of the kernel's ARRAY_SIZE and associated
      infrastructure is now gone.
      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>
      24fa6c08
    • J
      uml: host_info tidying · b4ffb6ad
      Jeff Dike 提交于
      Move the host_info string from util.c to um_arch.c, where it is
      actually initialized and used.  Also document its lack of locking.
      Signed-off-by: NJeff Dike <jdike@addtoit.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>
      b4ffb6ad
  5. 08 3月, 2007 1 次提交
  6. 12 2月, 2007 2 次提交
  7. 26 11月, 2006 1 次提交
    • P
      [PATCH] uml: make execvp safe for our usage · 5d48545e
      Paolo 'Blaisorblade' Giarrusso 提交于
      Reimplement execvp for our purposes - after we call fork() it is fundamentally
      unsafe to use the kernel allocator - current is not valid there.  So we simply
      pass to our modified execvp() a preallocated buffer.  This fixes a real bug
      and works very well in testing (I've seen indirectly warning messages from the
      forked thread - they went on the pipe connected to its stdout and where read
      as a number by UML, when calling read_output().  I verified the obtained
      number corresponded to "BUG:").
      
      The added use of __cant_sleep() is not a new bug since __cant_sleep() is
      already used in the same function - passing an atomicity parameter would be
      better but it would require huge change, stating that this function must not
      be called in atomic context and can sleep is a better idea (will make sure of
      this gradually).
      Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Acked-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5d48545e
  8. 12 10月, 2006 1 次提交
  9. 27 9月, 2006 2 次提交
    • 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
    • J
      [PATCH] uml: mark some tt-mode code · 0915ee38
      Jeff Dike 提交于
      Mark a symbol and file as being tt-mode only.  This shrinks the binary
      slightly when tt mode support is compiled out and makes it easier to identity
      stuff when tt mode is removed.
      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>
      0915ee38
  10. 26 9月, 2006 2 次提交
    • 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: 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
  11. 15 7月, 2006 1 次提交
  12. 11 7月, 2006 3 次提交
  13. 01 4月, 2006 4 次提交
  14. 28 3月, 2006 2 次提交