1. 07 9月, 2013 2 次提交
    • R
      um: ubd: Add REQ_FLUSH suppport · 805f11a0
      Richard Weinberger 提交于
      UML's block device driver does not support write barriers,
      to support this this patch adds REQ_FLUSH suppport.
      Every time the block layer sends a REQ_FLUSH we fsync() now
      our backing file to guarantee data consistency.
      Reported-and-tested-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      805f11a0
    • R
      um: Implement probe_kernel_read() · f75b1b1b
      Richard Weinberger 提交于
      UML needs it's own probe_kernel_read() to handle kernel
      mode faults correctly.
      The implementation uses mincore() on the host side to detect
      whether a page is owned by the UML kernel process.
      
      This fixes also a possible crash when sysrq-t is used.
      Starting with 3.10 sysrq-t calls probe_kernel_read() to
      read details from the kernel workers. As kernel worker are
      completely async pointers may turn NULL while reading them.
      
      Cc: <stian@nixia.no>
      Cc: <tj@kernel.org>
      Cc: <stable@vger.kernel.org> # 3.10.x
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      f75b1b1b
  2. 13 10月, 2012 1 次提交
  3. 10 10月, 2012 1 次提交
  4. 02 11月, 2011 4 次提交
  5. 25 5月, 2011 2 次提交
  6. 10 8月, 2010 1 次提交
  7. 23 10月, 2008 2 次提交
  8. 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
  9. 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
  10. 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
  11. 06 2月, 2008 10 次提交
  12. 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
  13. 17 10月, 2007 13 次提交