23 Mar, 2006

1 commit

  • Implement SMP alternatives, i.e. switching at runtime between different
    code versions for UP and SMP. The code can patch both SMP->UP and UP->SMP.
    The UP->SMP case is useful for CPU hotplug.

    With CONFIG_CPU_HOTPLUG enabled the code switches to UP at boot time and
    when the number of CPUs goes down to 1, and switches to SMP when the number
    of CPUs goes up to 2.

    Without CONFIG_CPU_HOTPLUG or on non-SMP-capable systems the code is
    patched once at boot time (if needed) and the tables are released
    afterwards.

    The changes in detail:

    * The current alternatives bits are moved to a separate file,
    the SMP alternatives code is added there.

    * The patch adds some new elf sections to the kernel:
    .smp_altinstructions
    like .altinstructions, also contains a list
    of alt_instr structs.
    .smp_altinstr_replacement
    like .altinstr_replacement, but also has some space to
    save original instruction before replaving it.
    .smp_locks
    list of pointers to lock prefixes which can be nop'ed
    out on UP.
    The first two are used to replace more complex instruction
    sequences such as spinlocks and semaphores. It would be possible
    to deal with the lock prefixes with that as well, but by handling
    them as special case the table sizes become much smaller.

    * The sections are page-aligned and padded up to page size, so they
    can be free if they are not needed.

    * Splitted the code to release init pages to a separate function and
    use it to release the elf sections if they are unused.

    Signed-off-by: Gerd Hoffmann
    Signed-off-by: Chuck Ebbert
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerd Hoffmann
     

22 Mar, 2006

2 commits

  • set_page_count usage outside mm/ is limited to setting the refcount to 1.
    Remove set_page_count from outside mm/, and replace those users with
    init_page_count() and set_page_refcounted().

    This allows more debug checking, and tighter control on how code is allowed
    to play around with page->_count.

    Signed-off-by: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • A couple of places set_page_count(page, 1) that don't need to.

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

    Nick Piggin
     

25 Feb, 2006

6 commits


08 Feb, 2006

6 commits

  • A previous patch removed a file from the build without removing it from the
    tree.

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

    Jeff Dike
     
  • 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
     
  • The network driver added an interface to the "opened" list when it was
    configured, not when it was brought up, and removed it when it was taken down.
    A sequence of ifconfig up, ifconfig down, ... caused it to be removed
    multiple times from the list without being added in between, resulting in a
    crash. This patch moves the add to when the interface is brought up.

    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
     
  • It doesn't do anything but emit a warning, but there's a user population
    that's used to adding 'debug' to the UML command line in order to gdb it.
    With skas0 mode, that's not necessary, but these users need some indication
    that 'debug' doesn't do what they want.

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

    Jeff Dike
     

02 Feb, 2006

9 commits


19 Jan, 2006

16 commits

  • Use the generic sys_rt_sigsuspend.

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

    Jeff Dike
     
  • Add support for TIF_RESTORE_SIGMASK. I copy the i386 handling of the flag.
    sys_sigsuspend is also changed to follow i386.
    Also a bit of cleanup -
    turn an if into a switch
    get rid of a couple more emacs formatting comments

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

    Jeff Dike
     
  • Correct a bit of whitespace problems while working here.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • When the user specifies both a COW file and its backing file, if the previous
    backing file is not found, currently UML tries again to use it and fails.

    This can be corrected by changing same_backing_files() return value in that
    case, so that the caller will try to change the COW file to point to the new
    location, as already done in other cases.

    Additionally, given the change in the meaning of the func, change its name,
    invert its return value, so all values are inverted except when
    stat(from_cow,&buf2) fails. And add some comments and two minor bugfixes -
    remove a fd leak (return err rather than goto out) and a repeated check.

    Tested well.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • *) mark as "EXPERIMENTAL" various items that either aren't very stable or
    that are actively crashing the setup of users which don't really need them
    (i.e. HIGHMEM and 3-level pagetables on x86 - nobody needs either,
    everybody reports "I'm using it and getting trouble").

    *) move net/Kconfig near to the rest of network configurations, and
    drivers/block/Kconfig near "Block layer" submenu.

    *) it's useless and doesn't work well to force NETDEVICES on and to disable
    the prompt like it's done. Better remove the attempt, and change that to a
    simple "default y if UML".

    *) drop the warning about "report problems about HPPFS" - it's redundant
    anyway, as that's the usual procedure, and HPPFS users are especially
    technical (i.e. they know reporting bugs is _good_).

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

    Paolo 'Blaisorblade' Giarrusso
     
  • 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
     
  • In a previous patch I shifted an allocation to being atomic.

    In this patch, a better but more intrusive solution is implemented, i.e. hold
    the lock only when really needing it, especially not over pipe operations, nor
    over the culprit allocation.

    Additionally, while at it, add a missing kfree in the failure path, and make
    sure that if we fail in forking, write_sigio_pid is -1 and not, say, -ENOMEM.

    And fix whitespace, at least for things I was touching anyway.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • In this error path, when the interface has had a problem, we call dev_close(),
    which is disallowed for two reasons:

    *) takes again the UML internal spinlock, inside the ->stop method of this
    device
    *) can be called in process context only, while we're in interrupt context.

    I've also thought that calling dev_close() may be a wrong policy to follow,
    but it's not up to me to decide that.

    However, we may end up with multiple dev_close() queued on the same device.
    But the initial test for (dev->flags & IFF_UP) makes this harmless, though -
    and dev_close() is supposed to care about races with itself. So there's no
    harm in delaying the shutdown, IMHO.

    Something to mark the interface as "going to shutdown" would be appreciated,
    but dev_deactivate has the same problems as dev_close(), so we can't use it
    either.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • Pre-clear transport-specific private structure before passing it down.

    In fact, I just got a slab corruption and kernel panic on exit because kfree()
    was called on a pointer which probably was never allocated, BUT hadn't been
    set to NULL by the driver.

    As the code is full of such errors, I've decided for now to go the safe way
    (we're talking about drivers), and to do the simple thing. I'm also starting
    to fix drivers, and already sent a patch for the daemon transport.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • Avoid uninitialized data in the daemon_data structure. I used this transport
    before doing proper setup before-hand, and I got some very nice SLAB
    corruption due to freeing crap pointers. So just make sure to clear
    everything when appropriate.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • Some fixes to make softints work in tt mode.

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

    Bodo Stroesser
     
  • Now that we are doing soft interrupts, there's no point in using sigsetjmp and
    siglongjmp. Using setjmp and longjmp saves a sigprocmask on every jump.

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

    Jeff Dike
     
  • 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