15 Sep, 2011

9 commits

  • richard@nod.at:
    Fixes:
    /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libc.a(strrchr.o): In function `rindex':
    (.text+0x0): multiple definition of `strrchr'

    If both STATIC_LINK and UML_NET_VDE are set to "y" libc's strrchr may
    clash with the kernel implementation.

    This workaround comes originally from Jeff Dike:
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494995#35

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • 1) take subarch-specific stuff to subarch_ptrace()
    2) PTRACE_{PEEK,POKE}{TEXT,DATA} is handled by ptrace_request() just fine...

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • It's 32bit-only, not 64bit-only... And while we are at it, it's
    set_fpxregs(), not set_fpregs()...

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • while not doing free_irq() from irq handler is commendable, kfree() on the
    data passed to said handler before free_irq() is Not Good(tm). Freeing
    the stack it's being run on is also not nice... Solution: delay actually
    freeing stuff.

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • ... so set winch->fd to -1 before doing free_irq(), to avoid having
    winch_interrupt() come from/during the latter and attempt to do
    reactivate_fd() on something that's already gone.

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • tty->count is decremented only after ->close() had been called and
    several tasks can hit it in parallel. As the result, using tty->count
    to check if you are the last one is broken. We end up leaving line->tty
    not reset to NULL and the next IRQ on that sucker will blow up trying to
    dereference pointers from kfree'd struct tty.

    Fix is obvious: we need to use a counter of our own.

    Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Some time ago Jeff prepared 42daba316557 ("uml: stop saving process FP
    state") for UML to stop saving the process FP state between task
    switches. The assumption was that since with SKAS0 every guest process
    runs inside a host process context the host OS will take care of keeping
    the proper FP state.

    Unfortunately this is not true for multi-threaded applications, where
    all guest threads share a single host process context yet all may use
    the FPU on their own. Although I haven't verified it I suspect things
    to be even worse in SKAS3 mode where all guest processes run inside a
    single host process.

    The patch reintroduces the saving and restoring of the FP context
    between task switches.

    [richard@nod.at: Ingo posted this patch in 2009, sadly it was never applied
    and got lost. Now in 2011 the problem was reported by Gunnar.]

    Signed-off-by: Ingo van Lil
    Signed-off-by: Richard Weinberger
    Reported-by:
    Tested-by:
    Cc: Stanislav Meduna
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo van Lil
     
  • I could use out_close1, but that seems to be the code path to close the fd
    returned by os_create_unix_socket, and using it to close the fd returned
    by mkstemp might lead to some confusion, so I don't do it.

    Signed-off-by: Jonathan Neuschäfer
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Neuschäfer
     
  • Commit b789ef518b2 ("slub: Add cmpxchg_double_slab()") tests for
    cmpxchg_double support in the SLUB code and it breaks UML builds with
    SLUB. Since UML does not support checking for CPU features, disable
    CMPXCHG_DOUBLE just like CMPXCHG_LOCAL is disabled for UML.

    Signed-off-by: Thadeu Lima de Souza Cascardo
    Reviewed-by: Christoph Lameter
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thadeu Lima de Souza Cascardo
     

27 Jul, 2011

1 commit


26 Jul, 2011

19 commits

  • * Merge akpm patch series: (122 commits)
    drivers/connector/cn_proc.c: remove unused local
    Documentation/SubmitChecklist: add RCU debug config options
    reiserfs: use hweight_long()
    reiserfs: use proper little-endian bitops
    pnpacpi: register disabled resources
    drivers/rtc/rtc-tegra.c: properly initialize spinlock
    drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in twl_rtc_set_time()
    drivers/rtc: add support for Qualcomm PMIC8xxx RTC
    drivers/rtc/rtc-s3c.c: support clock gating
    drivers/rtc/rtc-mpc5121.c: add support for RTC on MPC5200
    init: skip calibration delay if previously done
    misc/eeprom: add eeprom access driver for digsy_mtc board
    misc/eeprom: add driver for microwire 93xx46 EEPROMs
    checkpatch.pl: update $logFunctions
    checkpatch: make utf-8 test --strict
    checkpatch.pl: add ability to ignore various messages
    checkpatch: add a "prefer __aligned" check
    checkpatch: validate signature styles and To: and Cc: lines
    checkpatch: add __rcu as a sparse modifier
    checkpatch: suggest using min_t or max_t
    ...

    Did this as a merge because of (trivial) conflicts in
    - Documentation/feature-removal-schedule.txt
    - arch/xtensa/include/asm/uaccess.h
    that were just easier to fix up in the merge than in the patch series.

    Linus Torvalds
     
  • GCC 4.6's -Wunused-but-set-variable found some dead code.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • Linux can have pids up to 4*1024*1024. To handle such huge numbers
    pid_buf needs to be larger.

    Reported-by: Geert Uytterhoeven
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • Until now UML had no x86_64 vDSO. So glibc always used the vsyscall page
    for gettimeday() and friends. Calls to gettimeday() returned falsely the
    host time and confused some programs.

    This patch adds a vDSO which turns all __vdso_* calls into a system call
    so that UML can trap them.

    As glibc still uses the vsyscall page for static binaries this patch
    improves the situation only for dynamic binaries.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • Implement arch_vma_name() and make get_gate_vma(), in_gate_area() and
    in_gate_area_no_mm() a nop.

    We need arch_vma_name() to support vDSO.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • When UML is unable to reuse the host's vDSO FIXADDR_USER_START is zero.
    To handle this special case correclty we have to implement custom gate
    area helper methods.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • Reusing the host's vDSO makes only sense on x86_32.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • When creating the temp file there's a memory and file descriptor leak upon
    error.

    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Richard Weinberger
    Reviewed-by: Vitaliy Ivanov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     
  • Do not free memory when you failed to allocate it.

    Signed-off-by: Vitaliy Ivanov
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaliy Ivanov
     
  • Fix this warning:

    arch/um/os-Linux/helper.c: In function `helper_child':
    arch/um/os-Linux/helper.c:38:7: warning: ignoring return value of `write', declared with attribute warn_unused_result

    [richard@nod.at: happens only with -D_FORTIFY_SOURCE=2]
    Signed-off-by: Vitaliy Ivanov
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaliy Ivanov
     
  • Fix this warning:

    arch/um/drivers/cow_user.c: In function `absolutize':
    arch/um/drivers/cow_user.c:189:7: warning: ignoring return value of `chdir', declared with attribute warn_unused_result

    [richard@nod.at: happens only with -D_FORTIFY_SOURCE=2]
    Signed-off-by: Vitaliy Ivanov
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaliy Ivanov
     
  • Perform memory cleanup on exit. On receiving invalid 'pid' we still
    should clean 'output' variable.

    Signed-off-by: Vitaliy Ivanov
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaliy Ivanov
     
  • Commit 0954828fcbf3 ("kconfig: replace KERNELVERSION usage by the
    mainmenu's prompt") made the kernel version disappear from the generated
    .config file when configuring for UML. As UML's Kconfig doesn't have a
    mainmenu, kconfig falls back to the default string "Linux Kernel
    Configuration".

    Add a suitable mainmenu to the main UML Kconfig file to fix this.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • To make netconsole usable on UML, its ethernet driver needs netpoll
    support.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • When UML is compiled with _FORTIFY_SOURCE we have to export all _chk()
    functions which are used in modules. For now it's only the case for
    __sprintf_chk().

    Tested-by: Florian Fainelli
    Reported-by: Florian Fainelli
    Signed-off-by: Richard Weinberger
    Acked-by: Vitaliy Ivanov
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • Both sys-i386 and sys-x86_64 support now ndelay(). The delay functions
    are based on arch/x86/lib/delay.c.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • The address limit is already set in flush_old_exec() so this
    set_fs(USER_DS) is redundant.

    Signed-off-by: Mathias Krause
    Cc: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathias Krause
     
  • There is no need to define VM_{STACK,DATA}_DEFAULT_FLAGS as variable.
    It's also useless to test for TIF_IA32 as 64bit UML has no IA32 emulation.

    Signed-off-by: Richard Weinberger
    Acked-by: Randy Dunlap
    Cc: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    fs: Merge split strings
    treewide: fix potentially dangerous trailing ';' in #defined values/expressions
    uwb: Fix misspelling of neighbourhood in comment
    net, netfilter: Remove redundant goto in ebt_ulog_packet
    trivial: don't touch files that are removed in the staging tree
    lib/vsprintf: replace link to Draft by final RFC number
    doc: Kconfig: `to be' -> `be'
    doc: Kconfig: Typo: square -> squared
    doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
    drivers/net: static should be at beginning of declaration
    drivers/media: static should be at beginning of declaration
    drivers/i2c: static should be at beginning of declaration
    XTENSA: static should be at beginning of declaration
    SH: static should be at beginning of declaration
    MIPS: static should be at beginning of declaration
    ARM: static should be at beginning of declaration
    rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
    Update my e-mail address
    PCIe ASPM: forcedly -> forcibly
    gma500: push through device driver tree
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
    - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
    - drivers/net/r8169.c (just context changes)

    Linus Torvalds
     

24 Jul, 2011

1 commit

  • …us' and 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Make rwsem.S depend on CONFIG_RWSEM_XCHGADD_ALGORITHM

    * 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    debug: Make CONFIG_EXPERT select CONFIG_DEBUG_KERNEL to unhide debug options

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Remove unused CHECK_IRQ_PER_CPU()

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf tools, x86: Fix 32-bit compile on 64-bit system

    Linus Torvalds
     

23 Jul, 2011

2 commits


21 Jul, 2011

2 commits

  • All these are instances of
    #define NAME value;
    or
    #define NAME(params_opt) value;

    These of course fail to build when used in contexts like
    if(foo $OP NAME)
    while(bar $OP NAME)
    and may silently generate the wrong code in contexts such as
    foo = NAME + 1; /* foo = value; + 1; */
    bar = NAME - 1; /* bar = value; - 1; */
    baz = NAME & quux; /* baz = value; & quux; */

    Reported on comp.lang.c,
    Message-ID:
    Initial analysis of the dangers provided by Keith Thompson in that thread.

    There are many more instances of more complicated macros having unnecessary
    trailing semicolons, but this pile seems to be all of the cases of simple
    values suffering from the problem. (Thus things that are likely to be found
    in one of the contexts above, more complicated ones aren't.)

    Signed-off-by: Phil Carmody
    Signed-off-by: Jiri Kosina

    Phil Carmody
     
  • Rather than having two functionally identical implementations
    for 32- and 64-bit configurations, use the previously extended
    assembly abstractions to fold the rwsem two implementations into
    a shared one.

    Signed-off-by: Jan Beulich
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/4E258DF3020000780004E3ED@nat28.tlf.novell.com
    Signed-off-by: Ingo Molnar

    Jan Beulich
     

28 Jun, 2011

1 commit


27 May, 2011

1 commit

  • By the previous style change, CONFIG_GENERIC_FIND_NEXT_BIT,
    CONFIG_GENERIC_FIND_BIT_LE, and CONFIG_GENERIC_FIND_LAST_BIT are not used
    to test for existence of find bitops anymore.

    Signed-off-by: Akinobu Mita
    Acked-by: Greg Ungerer
    Cc: Arnd Bergmann
    Cc: Russell King
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

25 May, 2011

4 commits

  • Most arches define CONFIG_DEBUG_STACK_USAGE exactly the same way. Move it
    to lib/Kconfig.debug so each arch doesn't have to define it. This
    obviously makes the option generic, but that's fine because the config is
    already used in generic code.

    It's not obvious to me that sysrq-P actually does anything caution by
    keeping the most inclusive wording.

    Signed-off-by: Stephen Boyd
    Cc: Chris Metcalf
    Acked-by: David S. Miller
    Acked-by: Richard Weinberger
    Acked-by: Mike Frysinger
    Cc: Russell King
    Cc: Hirokazu Takata
    Acked-by: Ralf Baechle
    Cc: Paul Mackerras
    Acked-by: Benjamin Herrenschmidt
    Cc: Chen Liqin
    Cc: Lennox Wu
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • This constant hasn't been used since before the git era (2.6.12) and thus
    can be dropped.

    Signed-off-by: Stephen Boyd
    Cc: Russell King
    Cc: Richard Weinberger
    Cc: Hirokazu Takata
    Cc: Kyle McMartin
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • os_dump_core() emits SIGTERM to terminate all UML processes. Kernel
    threads have to exit on SIGTERM instead of calling last_ditch_exit().
    Multiple calls to last_ditch_exit() can cause a crash.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • Fix build failures on UML.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger