25 Feb, 2006

2 commits


08 Feb, 2006

3 commits

  • We weren't making sure that we initialized the FP registers of new processes
    to sane values.

    This patch also moves some defines in the affected area closer to where they
    are used.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The process that UML uses to probe the host's ptrace capabilities can (rarely)
    receive a SIGWINCH, confusing the parent. This fixes that by blocking
    SIGWINCH.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • When UML opens a TUN/TAP device, the file descriptor could be copied into
    later, long-lived threads, holding the device open even after the interface is
    taken down, preventing it from being brought up again. This patch makes these
    descriptors close-on-exec so that they disappear from helper processes, and
    adds CLONE_FILES to a UML helper thread so that the descriptors are closed in
    the thread when they are closed elsewhere in UML.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

19 Jan, 2006

8 commits

  • Ugly trick to help make malloc not sleeping - we can't do anything else. But
    this is not yet optimal, since spinlock don't trigger in_atomic() when
    preemption is disabled.

    Also, even if ugly, this was already used in one place, and was even more
    bogus. Fix it.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • 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: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Stop using global variables to hold the file descriptor and offset used to map
    the skas0 stubs. Instead, calculate them using the page physical addresses.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The serial UML OS-abstraction layer patch (um/kernel/skas dir).

    This moves all systemcalls from skas/process.c file under os-Linux dir and
    join skas/process.c and skas/process_kern.c files.

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gennady Sharapov
     
  • The serial UML OS-abstraction layer patch (um/kernel/skas dir).

    This moves all systemcalls from skas/mem_user.c file under os-Linux dir and
    join skas/mem_user.c and skas/mem.c files.

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gennady Sharapov
     
  • Current implementation of boot_timer_handler isn't usable for s390. So I
    changed its name to do_boot_timer_handler, taking (struct sigcontext *)sc as
    argument. do_boot_timer_handler is called from new boot_timer_handler() in
    arch/um/os-Linux/signal.c, which uses the same mechanisms as other signal
    handler to find out sigcontext pointer.

    Signed-off-by: Bodo Stroesser
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bodo Stroesser
     
  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all systemcalls from time.c file under os-Linux dir and joins
    time.c and tine_kernel.c files

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gennady Sharapov
     
  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all systemcalls from user_util.c file under os-Linux dir

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gennady Sharapov
     

09 Jan, 2006

4 commits


07 Jan, 2006

4 commits

  • This patch cleans up the umid code:

    - The only_if_set argument to get_umid is gone.

    - get_umid returns an empty string rather than NULL if there is no umid.

    - umid_is_random is gone since its users went away.

    - Some printfs were turned into printks because the code runs late enough
    that printk is working.

    - Error paths were cleaned up.

    - Some functions now return an error and let the caller print the error
    message rather than printing it themselves. This eliminates the practice of
    passing a pointer to printf or printk in, depending on where in the boot
    process we are.

    - Major tidying of not_dead_yet - mostly error path cleanup, plus a comment
    explaining why it doesn't react to errors the way you might expect.

    - Calls to os_* interfaces that were moved under os are changed back to
    their native libc forms.

    - snprintf, strlcpy, and their bounds-checking friends are used more often,
    replacing by-hand bounds checking in some places.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • I reworked Gennady's umid OS abstraction patch because the code shouldn't
    be moved entirely to os. As it turns out, I moved most of it anyway. This
    patch is the minimal one needed to move the code and have it work.
    It turns out that the concept of the umid is OS-independent, but
    almost everything else about the implementation is OS-dependent.

    This is code movement without cleanup - a follow-on patch tidies
    everything up without shuffling code around.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch makes a bunch of non-functional changes -
    return(foo); becomes return foo;
    some statements are broken across lines for readability
    some trailing whitespace is cleaned up
    open_one_chan took four arguments, three of which could be
    deduced from the first. Accordingly, they were eliminated.
    some examples of "} else {" had a newline added
    some whitespace cleanup in the indentation
    lines_init got some control flow cleanup
    some long lines were broken
    removed another emacs-specific C formatting comment

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • There are a few functions which are declared to return something, but don't.
    These are actually infinite loops which are forced to be declared as non-void.
    This makes them all return 0.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

30 Dec, 2005

2 commits

  • Today, when compiling UML, I got warnings for two used unexported symbols:
    readdir64 and truncate64. Indeed, my glibc headers are aliasing readdir to
    readdir64 and truncate to truncate64 (and so on).

    I'm then adding additional exports. Since I've no idea if the symbols where
    always provided in the supported glibc's, I've added weak definitions too.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • Don't use printk() where "current_thread_info()" is crap.

    Until when we switch to running on init_stack, current_thread_info() evaluates
    to crap. Printk uses "current" at times (in detail, ¤t is evaluated with
    CONFIG_DEBUG_SPINLOCK to check the spinlock owner task).

    And this leads to random segmentation faults.

    Exactly, what happens is that ¤t = *(current_thread_info()), i.e. round
    down $esp and dereference the value. I.e. access the stack below $esp, which
    causes SIGSEGV on a VM_GROWSDOWN vma (see arch/i386/mm/fault.c).

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     

07 Nov, 2005

5 commits

  • A number of fixes to improve behavior when large physical memory sizes
    are specified:

    - libc files need -D_FILE_OFFSET_BITS=64 because there are unavoidable uses
    of non-64 interfaces in libc

    - some %d need to be %u

    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Patch imlements full LDT handling in SKAS:
    * UML holds it's own LDT table, used to deliver data on
    modify_ldt(READ)
    * UML disables the default_ldt, inherited from the host (SKAS3)
    or resets LDT entries, set by host's clib and inherited in
    SKAS0
    * A new global variable skas_needs_stub is inserted, that
    can be used to decide, whether stub-pages must be supported
    or not.
    * Uses the syscall-stub to replace missing PTRACE_LDT (therefore,
    write_ldt_entry needs to be modified)

    Signed-off-by: Bodo Stroesser
    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bodo Stroesser
     
  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all systemcalls from helper.c file under os-Linux dir

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all systemcalls from main.c file under os-Linux dir and joins mem.c
    and um_arch.c files.

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all systemcalls from uaccess_user.c file under os-Linux dir

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gennady Sharapov
     

12 Oct, 2005

1 commit

  • The patch to use host AIO support that I submitted early after 2.6.13 exposed
    some problems in the block driver. I have fixes for these, but am not
    comfortable putting them into 2.6.14 at this late date. So, this patch reverts
    the use of host AIO.

    I will resubmit the original patch, plus fixes to the driver after 2.6.14
    in order to get a reasonable amount of testing before they're exposed to
    the general public.

    Signed-off-by: Jeff Dike
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

10 Oct, 2005

1 commit


05 Oct, 2005

1 commit

  • The old code had the IP and SP coming from the registers in the thread
    struct, which are completely wrong since those are the userspace
    registers. This fixes that by pulling the correct values from the
    jmp_buf in which the kernel state of each thread is stored.

    Signed-off-by: Allan Graves
    Signed-off-by: Jeff Dike
    Signed-off-by: Linus Torvalds

    Allan Graves
     

29 Sep, 2005

1 commit

  • UML makefiles sanitized:
    - number of generated headers reduced to 2 (from user-offsets.c and
    kernel-offsets.c resp.). The rest is made constant and simply
    includes those two.
    - mk_... helpers are gone now that we don't need to generate these
    headers
    - arch/um/include2 removed since everything under arch/um/include/sysdep
    is constant now and symlink can point straight to source tree.
    - dependencies seriously simplified.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

22 Sep, 2005

3 commits


18 Sep, 2005

5 commits

  • asm/elf.h is bad on x86_64, and i386 doesn't need it any more after Al's
    cleanup.

    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • do_aio used to return -1 on error instead of errno.

    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all system calls from mem_user.c and tempfile.c files under
    os-Linux dir.

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The poster child for this patch is the third tuntap_user hunk. When an ioctl
    fails, it properly closes the opened file descriptor and returns. However,
    the close resets errno to 0, and the 'return errno' that follows returns 0
    rather than the value that ioctl set. This caused the caller to believe that
    the device open succeeded and had opened file descriptor 0, which caused no
    end of interesting behavior.

    The rest of this patch is a pass through the UML sources looking for places
    where errno could be reset before being passed back out. A common culprit is
    printk, which could call write, being called before errno is returned.

    In some cases, where the code ends up being much smaller, I just deleted the
    printk.

    There was another case where a caller of run_helper looked at errno after a
    failure, rather than the return value of run_helper, which was the errno value
    that it wanted.

    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • These ugly double-casts are the result of gdb complaining about size

    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike