20 Jul, 2007

3 commits

  • Change in 'kbuild: do section mismatch check on full vmlinux'
    should've been replicated in arch/um/Makefile.

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

    Al Viro
     
  • Currently, CONFIG_X86_CMPXCHG64 both enables boot-time checking of
    the cmpxchg64b feature and enables compilation of the set_64bit() family.
    Since the option is dependent on PAE, and since KVM depends on set_64bit(),
    this effectively disables KVM on i386 nopae.

    Simplify by removing the config option altogether: the boot check is made
    dependent on CONFIG_X86_PAE directly, and the set_64bit() family is exposed
    without constraints. It is up to users to check for the feature flag (KVM
    does not as virtualiation extensions imply its existence).

    Signed-off-by: Avi Kivity
    Signed-off-by: Linus Torvalds

    Avi Kivity
     
  • This patch completes Linus's wish that the fault return codes be made into
    bit flags, which I agree makes everything nicer. This requires requires
    all handle_mm_fault callers to be modified (possibly the modifications
    should go further and do things like fault accounting in handle_mm_fault --
    however that would be for another patch).

    [akpm@linux-foundation.org: fix alpha build]
    [akpm@linux-foundation.org: fix s390 build]
    [akpm@linux-foundation.org: fix sparc build]
    [akpm@linux-foundation.org: fix sparc64 build]
    [akpm@linux-foundation.org: fix ia64 build]
    Signed-off-by: Nick Piggin
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Ian Molton
    Cc: Bryan Wu
    Cc: Mikael Starvik
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: "Luck, Tony"
    Cc: Hirokazu Takata
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Cc: Greg Ungerer
    Cc: Matthew Wilcox
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Richard Curnow
    Cc: William Lee Irwin III
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Miles Bader
    Cc: Chris Zankel
    Acked-by: Kyle McMartin
    Acked-by: Haavard Skinnemoen
    Acked-by: Ralf Baechle
    Acked-by: Andi Kleen
    Signed-off-by: Andrew Morton
    [ Still apparently needs some ARM and PPC loving - Linus ]
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

18 Jul, 2007

3 commits

  • Signed-off-by: Al Viro
    Acked-by: Jeff Dike
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Identical implementations of PTRACE_POKEDATA go into generic_ptrace_pokedata()
    function.

    AFAICS, fix bug on xtensa where successful PTRACE_POKEDATA will nevertheless
    return EPERM.

    Signed-off-by: Alexey Dobriyan
    Cc: Christoph Hellwig
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Identical implementations of PTRACE_PEEKDATA go into generic_ptrace_peekdata()
    function.

    Signed-off-by: Alexey Dobriyan
    Cc: Christoph Hellwig
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

17 Jul, 2007

12 commits

  • I forgot this file was here. It hasn't been used since UML has been in
    mainline.

    Thanks to Jesper for finding something that needed doing to it, thus reminding
    me of its existence.

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

    Jeff Dike
     
  • COWed devices can't handle more than 32 (64 on x86_64) sectors in one request
    due to the size of the bitmap being carried around in the io_thread_req.

    Enforce that by telling the block layer not to put too many sectors in
    requests to COWed devices.

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

    Jeff Dike
     
  • Add some exports for hostfs that are required after Alberto Bertogli's fixes
    for accessing unlinked host files.

    Also did some style cleanups while I was here.

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

    Jeff Dike
     
  • UML had two wrapper procedures for kmalloc, um_kmalloc and um_kmalloc_atomic
    because the flag constants weren't available in userspace code.
    kern_constants.h had made kernel constants available for a long time, so there
    is no need for these wrappers any more. Rather, userspace code calls kmalloc
    directly with the userspace versions of the gfp flags.

    kmalloc isn't a real procedure, so I had to essentially copy the inline
    wrapper around __kmalloc.

    vmalloc also had its own wrapper for no good reason. This is now gone.

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

    Jeff Dike
     
  • run_helper and run_helper_thread had arguments which were the same in all
    callers. run_helper's stack_out was always NULL and run_helper_thread's
    stack_order was always 0. These are now gone, and the constants folded
    into the code.

    Also fixed leaks of the helper stack in the AIO and SIGIO code.

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

    Jeff Dike
     
  • Cleanup of the SIGWINCH support.

    Some code and comment reformatting.

    The stack used for SIGWINCH threads was leaked. This is now fixed by storing
    it with the pid and other information, and freeing it when the thread is
    killed.

    If something goes wrong with a WIGWINCH thread, and this is discovered in the
    interrupt handler, the winch record would leak. It is now freed, except that
    the IRQ isn't freed. This is hard to do from interrupt context. This has the
    side-effect that the IRQ system maintains a reference to the freed structure,
    but that shouldn't cause a problem since the descriptor is disabled.

    register_winch_irq is now much better about cleaning up after an
    initialization failure.

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

    Jeff Dike
     
  • If the host side of a console can't be opened, this will now produce visible
    error messages.

    enable_chan now returns a status and this is passed up to con_open and
    ssl_open, which will complain if anything went wrong.

    The default host device for the serial line driver is now a pts device rather
    than a pty device since lots of hosts have LEGACY_PTYS disabled. This had
    always been failing on such hosts, but silently.

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

    Jeff Dike
     
  • Cleanup, mostly style violations.

    Tidied the includes.

    getmaster returns a real errno, which pty_open returns if there's a
    problem.

    The printks now have severity.

    Changed os_* calls to call libc directly.

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

    Jeff Dike
     
  • Major tidying of the xterm console driver:
    got rid of the tt-mode gdb support
    tidied up the includes
    fixed lots of style violations
    replaced os_* calls with glibc calls in xterm.c
    all printk calls now have a severity indicator
    the error paths of xterm_open are closer to being right

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

    Jeff Dike
     
  • DEBUG_SHIRQ generates spurious interrupts, triggering handlers such as
    mconsole_interrupt() or line_interrupt(). They expect data to be available to
    be read from their sockets/pipes, but in the case of spurious interrupts, the
    host didn't actually send anything, so UML hangs in read() and friends.
    Setting those fd's as O_NONBLOCK makes DEBUG_SHIRQ-enabled UML kernels boot
    and run correctly.

    Signed-off-by: Eduard-Gabriel Munteanu
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eduard-Gabriel Munteanu
     
  • Add generic exit-time stack-depth checking to CONFIG_DEBUG_STACK_USAGE.

    This also adds UML support.

    Tested on UML and i386.

    [akpm@linux-foundation.org: cleanups, speedups, tweaks]
    Signed-off-by: Jeff Dike
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • It is theoretically possible for a request to finish and be freed between
    writing it to the I/O thread and updating the sector count. In this case, the
    update will dereference a freed pointer.

    To avoid this, I delay the update until processing the next sg segment, when
    the request pointer is known to be good.

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

    Jeff Dike
     

17 Jun, 2007

1 commit

  • Distros seem to be removing PAGE_SIZE from asm/page.h. So, the libc side of
    UML should stop using it.

    I replace it with UM_KERN_PAGE_SIZE, which is defined to be the same as
    PAGE_SIZE on the kernel side of the house. I could also use getpagesize(),
    but it's more important that UML have the same value of PAGE_SIZE everywhere.
    It's conceivable that it could be built with a larger PAGE_SIZE, and use of
    getpagesize() would break that badly.

    PAGE_MASK got the same treatment, as it is closely tied to PAGE_SIZE.

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

    Jeff Dike
     

09 Jun, 2007

2 commits

  • Include linux/kernel.h wherever simple_strtoul is used. This kills a
    compile warning in stderr_console.c and potential ones in the other files.

    This also fixes a bunch of style violations in exitcode.c.

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

    Jeff Dike
     
  • Force KERNEL_STACK_ORDER to be at least 1 on UML/x86_64, to avoid overflows.

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

    Jeff Dike
     

24 May, 2007

1 commit

  • Make the PTRACE_SYSEMU checking more robust. It will make sure that system
    call numbers are reported correctly. If there is a problem, it will disable
    PTRACE_SYSEMU use and use PTRACE_SYSCALL instead.

    Thanks to Balaji G for helping reproduce this problem.

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

    Jeff Dike
     

19 May, 2007

2 commits


16 May, 2007

1 commit

  • __NR_syscall_max is done in x86_64 asm-offsets; do an equivalent in
    uml kern_constants.h

    Signed-off-by: Al Viro
    Acked-by: Jeff Dike
    Signed-off-by: Linus Torvalds

    Al Viro
     

11 May, 2007

5 commits

  • Make kernel stacks be 1 page on i386 and 2 pages on x86_64. These match the
    host values.

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

    Jeff Dike
     
  • Add a separate IRQ stack. This differs from i386 in having the entire
    interrupt run on a separate stack rather than starting on the normal kernel
    stack and switching over once some preparation has been done. The underlying
    mechanism, is of course, sigaltstack.

    Another difference is that interrupts that happen in userspace are handled on
    the normal kernel stack. These cause a wait wakeup instead of a signal
    delivery so there is no point in trying to switch stacks for these. There's
    no other stuff on the stack, so there is no extra stack consumption.

    This quirk makes it possible to have the entire interrupt run on a separate
    stack - process preemption (and calls to schedule()) happens on a normal
    kernel stack. If we enable CONFIG_PREEMPT, this will need to be rethought.

    The IRQ stack for CPU 0 is declared in the same way as the initial kernel
    stack. IRQ stacks for other CPUs will be allocated dynamically.

    An extra field was added to the thread_info structure. When the active
    thread_info is copied to the IRQ stack, the real_thread field points back to
    the original stack. This makes it easy to tell where to copy the thread_info
    struct back to when the interrupt is finished. It also serves as a marker of
    a nested interrupt. It is NULL for the first interrupt on the stack, and
    non-NULL for any nested interrupts.

    Care is taken to behave correctly if a second interrupt comes in when the
    thread_info structure is being set up or taken down. I could just disable
    interrupts here, but I don't feel like giving up any of the performance gained
    by not flipping signals on and off.

    If an interrupt comes in during these critical periods, the handler can't run
    because it has no idea what shape the stack is in. So, it sets a bit for its
    signal in a global mask and returns. The outer handler will deal with this
    signal itself.

    Atomicity is had with xchg. A nested interrupt that needs to bail out will
    xchg its signal mask into pending_mask and repeat in case yet another
    interrupt hit at the same time, until the mask stabilizes.

    The outermost interrupt will set up the thread_info and xchg a zero into
    pending_mask when it is done. At this point, nested interrupts will look at
    ->real_thread and see that no setup needs to be done. They can just continue
    normally.

    Similar care needs to be taken when exiting the outer handler. If another
    interrupt comes in while it is copying the thread_info, it will drop a bit
    into pending_mask. The outer handler will check this and if it is non-zero,
    will loop, set up the stack again, and handle the interrupt.

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

    Jeff Dike
     
  • Some tidying of the irq code before introducing irq stacks. Mostly
    style fixes, but the timer handler calls the timer code directly
    rather than going through the generic sig_handler_common_skas.

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

    Jeff Dike
     
  • Now that we have UM_THREAD_SIZE, we can replace the calculations in
    user-space code (an earlier patch took care of the kernel side of the
    house).

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

    Jeff Dike
     
  • Replaced task_protections with stack_protections since they do the same
    thing, and task_protections was misnamed anyway.

    This needs THREAD_SIZE, so that's imported via common-offsets.h

    Also tidied up the code in the vicinity.

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

    Jeff Dike
     

10 May, 2007

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits)
    sound: convert "sound" subdirectory to UTF-8
    MAINTAINERS: Add cxacru website/mailing list
    include files: convert "include" subdirectory to UTF-8
    general: convert "kernel" subdirectory to UTF-8
    documentation: convert the Documentation directory to UTF-8
    Convert the toplevel files CREDITS and MAINTAINERS to UTF-8.
    remove broken URLs from net drivers' output
    Magic number prefix consistency change to Documentation/magic-number.txt
    trivial: s/i_sem /i_mutex/
    fix file specification in comments
    drivers/base/platform.c: fix small typo in doc
    misc doc and kconfig typos
    Remove obsolete fat_cvf help text
    Fix occurrences of "the the "
    Fix minor typoes in kernel/module.c
    Kconfig: Remove reference to external mqueue library
    Kconfig: A couple of grammatical fixes in arch/i386/Kconfig
    Correct comments in genrtc.c to refer to correct /proc file.
    Fix more "deprecated" spellos.
    Fix "deprecated" typoes.
    ...

    Fix trivial comment conflict in kernel/relay.c.

    Linus Torvalds
     
  • These haven't been fixed for ages. Just make comments out of them.

    arch/um/kernel/skas/process.c:181:2: warning: #warning Need to look up
    +userspace_pid by cpu
    arch/um/kernel/skas/process.c:187:2: warning: #warning Need to look up
    +userspace_pid by cpu
    arch/um/kernel/skas/process.c:194:2: warning: #warning need to loop over
    +userspace_pids in kill_off_processes_skas

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

    Miklos Szeredi
     
  • Mark another function as tt-mode only.

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

    Jeff Dike
     
  • Enable (i)SCSI on UML, dunno why SCSI was deemed broken, it works like a
    charm.

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

    Peter Zijlstra
     

09 May, 2007

4 commits

  • Many files include the filename at the beginning, serveral used a wrong one.

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Adrian Bunk

    Uwe Kleine-König
     
  • Allow a pcap device to be assigned a MAC on the command line. They don't
    really need one, but it is handy to be able to do when your distro assigns a
    new ethernet device whenever it sees a new MAC.

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

    Jeff Dike
     
  • Some network device cleanup.

    When setup_etheraddr found a globally valid MAC being assigned to an
    interface, it went ahead and used it rather than assigning a random MAC like
    the other cases do. This isn't really an error like the others, but it seems
    consistent to make it behave the same.

    We were getting some duplicate kfree() in the error case in eth_configure
    because platform_device_unregister frees buffers that the error cases
    following tried to free again.

    The pcap initialization routine wasn't doing the proper printk of its
    information, causing a printk of the first part of that line to be
    unterminated by a newline.

    The pcap code had a bunch of style violations, which are now fixed.

    pcap_setup wasn't returning false when it detected an unrecognized
    option.

    The printks in pcap_user all got UM_KERN_BLAH prepended to their
    format strings.

    pcap_remove now checks for a non-NULL pcap structure before it calls
    pcap_close.

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

    Jeff Dike
     
  • The ever-vigilant users of linode.com noticed that an idle 2.6 UML has a
    persistent load average of ~.4.

    It turns out that because the UML timer handler processed softirqs before
    actually delivering the tick, the tick was counted in the context of the idle
    thread about half the time.

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

    Jeff Dike
     

08 May, 2007

2 commits

  • Declare strlcpy and strlcat more correctly.

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

    Paolo 'Blaisorblade' Giarrusso
     
  • With the current timekeeping, !CONFIG_UML_REAL_TIME_CLOCK has
    inconsistent behavior. Previously, gettimeofday could be (and was)
    isolated from the clock ticking. Now, it's not, so when
    CONFIG_UML_REAL_TIME_CLOCK is disabled, gettimeofday must progress in
    lockstep with the clock, making it fully virtual.

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

    Jeff Dike