1. 10 10月, 2012 1 次提交
  2. 02 11月, 2011 4 次提交
  3. 25 5月, 2011 2 次提交
  4. 10 8月, 2010 1 次提交
  5. 23 10月, 2008 2 次提交
  6. 07 6月, 2008 1 次提交
    • T
      uml: deal with inaccessible address space start · 40fb16a3
      Tom Spink 提交于
      This patch makes os_get_task_size locate the bottom of the address space,
      as well as the top.  This is for systems which put a lower limit on mmap
      addresses.  It works by manually scanning pages from zero onwards until a
      valid page is found.
      
      Because the bottom of the address space may not be zero, it's not
      sufficient to assume the top of the address space is the size of the
      address space.  The size is the difference between the top address and
      bottom address.
      
      [jdike@addtoit.com: changed the name to reflect that this function is
      supposed to return the top of the process address space, not its size and
      changed the return value to reflect that.  Also some minor formatting
      changes]
      Signed-off-by: NTom Spink <tspink@gmail.com>
      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>
      40fb16a3
  7. 13 5月, 2008 1 次提交
    • J
      uml: random driver fixes · 5d33e4d7
      Jeff Dike 提交于
      The random driver would essentially hang if the host's /dev/random returned
      -EAGAIN.  There was a test of need_resched followed by a schedule inside the
      loop, but that didn't help and it's the wrong way to work anyway.
      
      The right way is to ask for an interrupt when there is input available from
      the host and handle it then rather than polling.
      
      Now, when the host's /dev/random returns -EAGAIN, the driver asks for a wakeup
      when there's randomness available again and sleeps.  The interrupt routine
      just wakes up whatever processes are sleeping on host_read_wait.
      
      There is an atomic_t, host_sleep_count, which counts the number of processes
      waiting for randomness.  When this reaches zero, the interrupt is disabled.
      
      An added complication is that async I/O notification was only recently added
      to /dev/random (by me), so essentially all hosts will lack it.  So, we use the
      sigio workaround here, which is to have a separate thread poll on the
      descriptor and send an interrupt when there is input on it.  This mechanism is
      activated when a process gets -EAGAIN (activating this multiple times is
      harmless, if a bit wasteful) and deactivated by the last process still
      waiting.
      
      The module name was changed from "random" to "hw_random" in order for udev to
      recognize it.
      
      The sigio workaround needed some changes.  sigio_broken was added for cases
      when we know that async notification doesn't work.  This is now called from
      maybe_sigio_broken, which deals with pts devices.
      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>
      5d33e4d7
  8. 09 2月, 2008 1 次提交
    • J
      uml: runtime host VMSPLIT detection · 536788fe
      Jeff Dike 提交于
      Calculate TASK_SIZE at run-time by figuring out the host's VMSPLIT - this is
      needed on i386 if UML is to run on hosts with varying VMSPLITs without
      recompilation.
      
      TASK_SIZE is now defined in terms of a variable, task_size.  This gets rid of
      an include of pgtable.h from processor.h, which can cause include loops.
      
      On i386, task_size is calculated early in boot by probing the address space in
      a binary search to figure out where the boundary between usable and non-usable
      memory is.  This tries to make sure that a page that is considered to be in
      userspace is, or can be made, read-write.  I'm concerned about a system-global
      VDSO page in kernel memory being hit and considered to be a userspace page.
      
      On x86_64, task_size is just the old value of CONFIG_TOP_ADDR.
      
      A bunch of config variable are gone now.  CONFIG_TOP_ADDR is directly replaced
      by TASK_SIZE.  NEST_LEVEL is gone since the relocation of the stubs makes it
      irrelevant.  All the HOST_VMSPLIT stuff is gone.  All references to these in
      arch/um/Makefile are also gone.
      
      I noticed and fixed a missing extern in os.h when adding os_get_task_size.
      
      Note: This has been revised to fix the 32-bit UML on 64-bit host bug that
      Miklos ran into.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      536788fe
  9. 06 2月, 2008 10 次提交
  10. 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
  11. 17 10月, 2007 15 次提交
    • J
      uml: use *SEC_PER_*SEC constants · 1a805219
      Jeff Dike 提交于
      There are various uses of powers of 1000, plus the odd BILLION constant in the
      time code.  However, there are perfectly good definitions of *SEC_PER_*SEC in
      linux/time.h which can be used instaed.
      
      These are replaced directly in kernel code.  Userspace code imports those
      constants as UM_*SEC_PER_*SEC and uses these.
      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>
      1a805219
    • J
      uml: time build fix · 5f734614
      Jeff Dike 提交于
      Put back an implementation of timeval_to_ns in arch/um/os-Linux/time.c.
      tglx pointed out in his review of tickless support that there was a
      perfectly good implementation of it in linux/time.h.  The problem is that
      this is userspace code which can't pull in kernel headers and there doesn't
      seem to be a libc version.
      
      So, I'm copying the version from linux/time.h rather than resurrecting my
      version.  This causes some declaration changes as it now returns a signed
      value rather than an unsigned value.
      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>
      5f734614
    • J
      uml: eliminate interrupts in the idle loop · b160fb63
      Jeff Dike 提交于
      Now, the idle loop now longer needs SIGALRM firing - it can just sleep for the
      requisite amount of time and fake a timer interrupt when it finishes.
      
      Any use of ITIMER_REAL now goes away.  disable_timer only turns off
      ITIMER_VIRTUAL.  switch_timers is no longer needed, so it, and all calls, goes
      away.
      
      disable_timer now returns the amount of time remaining on the timer.
      default_idle uses this to tell idle_sleep how long to sleep.  idle_sleep will
      call alarm_handler if nanosleep returns 0, which is the case if it didn't
      return early due to an interrupt.  Otherwise, it just 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>
      b160fb63
    • 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
  12. 17 7月, 2007 1 次提交