23 Mar, 2011

3 commits

  • Commit 6caa76b ("tty: now phase out the ioctl file pointer for good")
    removed the ioctl file pointer. User Mode Linux's line driver uses this
    ioctl and needs a signature update too.

    Signed-off-by: Richard Weinberger
    Cc: Alan Cox
    Cc: Greg KH
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • One of our users reported that when a user-level program SIGSEGVs under
    UML kernel, the resulting core dump is not very usable.

    I have reproduced that with the latest kernel:

    make ARCH=um defconfig; make ARCH=um

    Run the resulting kernel, then "inside" run this program:

    #include

    void *fn(void *p)
    {
    abort();
    }

    int main()
    {
    pthread_t tid;
    pthread_create(&tid, 0, fn, 0);
    pthread_join(tid, 0);
    return 0;
    }

    Analyze the coredump with GDB. Here is what you'll see:

    sudo gdb -q -ex 'set solib-absolute-prefix ../root_fs' -ex 'file ../root_fs/var/tmp/mt-abort' -ex 'core ../root_fs/var/tmp/core.762'
    Reading symbols from /usr/local/google/root_fs/var/tmp/mt-abort...done.
    [New Thread 763]
    [New Thread 762]
    Core was generated by `./mt-abort'.
    Program terminated with signal 6, Aborted.
    #0 0x0000000040255250 in raise () from ../root_fs/lib64/libc.so.6
    (gdb) info thread
    2 Thread 762 0x0000000000000000 in ?? ()
    * 1 Thread 763 0x0000000040255250 in raise () from ../root_fs/lib64/libc.so.6

    Note that thread#2 looks funny.

    (gdb) thread 2
    [Switching to thread 2 (Thread 762)]#0 0x0000000000000000 in ?? ()
    (gdb) info reg
    rax 0x0 0
    rbx 0x0 0
    rcx 0x0 0
    rdx 0x0 0
    rsi 0x0 0
    rdi 0x0 0
    rbp 0x0 0x0
    rsp 0x0 0x0
    r8 0x0 0
    r9 0x0 0
    r10 0x0 0
    r11 0x0 0
    r12 0x0 0
    r13 0x0 0
    r14 0x0 0
    r15 0x0 0
    rip 0x0 0
    eflags 0x0 [ ]
    cs 0x0 0
    ss 0x0 0
    ds 0x0 0
    es 0x0 0
    fs 0x0 0
    gs 0x0 0

    Examining the core shows that NT_PRSTATUS notes for all threads other than
    the one that crashed are zeroed out.

    I believe this is happening because neither ELF_CORE_COPY_TASK_REGS nor
    task_pt_regs are defined under ARCH=um, and so elf_core_copy_task_regs()
    becomes a no-op.

    Attached patch fixes this for SUBARCH={x86_64,i386}.

    Signed-off-by: Paul Pluzhnikov
    Cc: Jeff Dike
    Acked-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Pluzhnikov
     
  • All kthreads being created from a single helper task, they all use memory
    from a single node for their kernel stack and task struct.

    This patch suite creates kthread_create_on_cpu(), adding a 'cpu' parameter
    to parameters already used by kthread_create().

    This parameter serves in allocating memory for the new kthread on its
    memory node if available.

    Users of this new function are : ksoftirqd, kworker, migration, pktgend...

    This patch:

    Add a node parameter to alloc_task_struct(), and change its name to
    alloc_task_struct_node()

    This change is needed to allow NUMA aware kthread_create_on_cpu()

    Signed-off-by: Eric Dumazet
    Acked-by: David S. Miller
    Reviewed-by: Andi Kleen
    Acked-by: Rusty Russell
    Cc: Tejun Heo
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: David Howells
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

21 Mar, 2011

1 commit

  • * 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
    video: change to new flag variable
    scsi: change to new flag variable
    rtc: change to new flag variable
    rapidio: change to new flag variable
    pps: change to new flag variable
    net: change to new flag variable
    misc: change to new flag variable
    message: change to new flag variable
    memstick: change to new flag variable
    isdn: change to new flag variable
    ieee802154: change to new flag variable
    ide: change to new flag variable
    hwmon: change to new flag variable
    dma: change to new flag variable
    char: change to new flag variable
    fs: change to new flag variable
    xtensa: change to new flag variable
    um: change to new flag variables
    s390: change to new flag variable
    mips: change to new flag variable
    ...

    Fix up trivial conflict in drivers/hwmon/Makefile

    Linus Torvalds
     

17 Mar, 2011

1 commit


16 Mar, 2011

4 commits

  • * 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
    percpu, x86: Add arch-specific this_cpu_cmpxchg_double() support
    percpu: Generic support for this_cpu_cmpxchg_double()
    alpha: use L1_CACHE_BYTES for cacheline size in the linker script
    percpu: align percpu readmostly subsection to cacheline

    Fix up trivial conflict in arch/x86/kernel/vmlinux.lds.S due to the
    percpu alignment having changed ("x86: Reduce back the alignment of the
    per-CPU data section")

    Linus Torvalds
     
  • * 'um-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Select GENERIC_HARDIRQS_NO_DEPRECATED
    um: Use proper accessors in show_interrupts()
    um: Convert irq_chips to new functions
    um: Remove stale irq_chip.end

    Linus Torvalds
     
  • * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, binutils, xen: Fix another wrong size directive
    x86: Remove dead config option X86_CPU
    x86: Really print supported CPUs if PROCESSOR_SELECT=y
    x86: Fix a bogus unwind annotation in lib/semaphore_32.S
    um, x86-64: Fix UML build after adding CFI annotations to lib/rwsem_64.S
    x86: Remove unused bits from lib/thunk_*.S
    x86: Use {push,pop}_cfi in more places
    x86-64: Add CFI annotations to lib/rwsem_64.S
    x86, asm: Cleanup unnecssary macros in asm-offsets.c
    x86, system.h: Drop unused __SAVE/__RESTORE macros
    x86: Use bitmap library functions
    x86: Partly unify asm-offsets_{32,64}.c
    x86: Reduce back the alignment of the per-CPU data section

    Linus Torvalds
     
  • …el/git/tip/linux-2.6-tip

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    rtmutex: tester: Remove the remaining BKL leftovers
    lockdep/timers: Explain in detail the locking problems del_timer_sync() may cause
    rtmutex: Simplify PI algorithm and make highest prio task get lock
    rwsem: Remove redundant asmregparm annotation
    rwsem: Move duplicate function prototypes to linux/rwsem.h
    rwsem: Unify the duplicate rwsem_is_locked() inlines
    rwsem: Move duplicate init macros and functions to linux/rwsem.h
    rwsem: Move duplicate struct rwsem declaration to linux/rwsem.h
    x86: Cleanup rwsem_count_t typedef
    rwsem: Cleanup includes
    locking: Remove deprecated lock initializers
    cred: Replace deprecated spinlock initialization
    kthread: Replace deprecated spinlock initialization
    xtensa: Replace deprecated spinlock initialization
    um: Replace deprecated spinlock initialization
    sparc: Replace deprecated spinlock initialization
    mips: Replace deprecated spinlock initialization
    cris: Replace deprecated spinlock initialization
    alpha: Replace deprecated spinlock initialization
    rtmutex-tester: Remove BKL tests

    Linus Torvalds
     

14 Mar, 2011

1 commit

  • new function: file_open_root(dentry, mnt, name, flags) opens the file
    vfs_path_lookup would arrive to.

    Note that name can be empty; in that case the usual requirement that
    dentry should be a directory is lifted.

    open-coded equivalents switched to it, may_open() got down exactly
    one caller and became static.

    Signed-off-by: Al Viro

    Al Viro
     

09 Mar, 2011

1 commit


01 Mar, 2011

1 commit


15 Feb, 2011

4 commits


27 Jan, 2011

1 commit


25 Jan, 2011

1 commit

  • Currently percpu readmostly subsection may share cachelines with other
    percpu subsections which may result in unnecessary cacheline bounce
    and performance degradation.

    This patch adds @cacheline parameter to PERCPU() and PERCPU_VADDR()
    linker macros, makes each arch linker scripts specify its cacheline
    size and use it to align percpu subsections.

    This is based on Shaohua's x86 only patch.

    Signed-off-by: Tejun Heo
    Cc: Shaohua Li

    Tejun Heo
     

21 Jan, 2011

3 commits

  • No functional change.

    Signed-off-by: Thomas Gleixner
    Cc: Andrew Morton
    Cc: Jeff Dike

    Thomas Gleixner
     
  • All architectures are finally converted. Remove the cruft.

    Signed-off-by: Thomas Gleixner
    Cc: Richard Henderson
    Cc: Mike Frysinger
    Cc: David Howells
    Cc: Tony Luck
    Cc: Greg Ungerer
    Cc: Michal Simek
    Acked-by: David Howells
    Cc: Kyle McMartin
    Acked-by: Benjamin Herrenschmidt
    Cc: Chen Liqin
    Cc: "David S. Miller"
    Cc: Chris Metcalf
    Cc: Jeff Dike

    Thomas Gleixner
     
  • The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
    is used to configure any non-standard kernel with a much larger scope than
    only small devices.

    This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
    references to the option throughout the kernel. A new CONFIG_EMBEDDED
    option is added that automatically selects CONFIG_EXPERT when enabled and
    can be used in the future to isolate options that should only be
    considered for embedded systems (RISC architectures, SLOB, etc).

    Calling the option "EXPERT" more accurately represents its intention: only
    expert users who understand the impact of the configuration changes they
    are making should enable it.

    Reviewed-by: Ingo Molnar
    Acked-by: David Woodhouse
    Signed-off-by: David Rientjes
    Cc: Greg KH
    Cc: "David S. Miller"
    Cc: Jens Axboe
    Cc: Arnd Bergmann
    Cc: Robin Holt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

14 Jan, 2011

5 commits

  • pte alloc routines must wait for split_huge_page if the pmd is not present
    and not null (i.e. pmd_trans_splitting). The additional branches are
    optimized away at compile time by pmd_trans_splitting if the config option
    is off. However we must pass the vma down in order to know the anon_vma
    lock to wait for.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Andrea Arcangeli
    Acked-by: Rik van Riel
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • Simplify write file operation for mmapper by using
    simple_write_to_buffer().

    Signed-off-by: Akinobu Mita
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Add missing MODULE_LICENSE():

    WARNING: modpost: missing MODULE_LICENSE() in arch/um/drivers/mmapper_kern.o

    Signed-off-by: Randy Dunlap
    Cc: Greg Lonnon
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • unregister_winch() should use list_for_each_safe(), as it can delete from
    the list.

    Signed-off-by: Will Newton
    Cc: richard -rw- weinberger
    Acked-by: WANG Cong
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Newton
     
  • Currently CONFIG_HIGHMEM is broken on User Mode Linux. I'm not sure if it
    worked ever.

    It doesn't compile and this breaks randomconfig testing.

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

    Richard Weinberger
     

25 Nov, 2010

1 commit

  • Disable the winch irq early to make sure we don't take an interrupt part
    way through the freeing of the handler data, resulting in a crash on
    shutdown:

    winch_interrupt : read failed, errno = 9
    fd 13 is losing SIGWINCH support
    ------------[ cut here ]------------
    WARNING: at lib/list_debug.c:48 list_del+0xc6/0x100()
    list_del corruption, next is LIST_POISON1 (00100100)
    082578c8: [] dump_stack+0x22/0x24
    082578e0: [] warn_slowpath_common+0x5a/0x80
    08257908: [] warn_slowpath_fmt+0x2e/0x30
    08257920: [] list_del+0xc6/0x100
    08257940: [] free_winch+0x14/0x80
    08257958: [] winch_interrupt+0xdb/0xe0
    08257978: [] handle_IRQ_event+0x35/0xe0
    08257998: [] handle_edge_irq+0xb7/0x170
    082579bc: [] do_IRQ+0x34/0x50
    082579d4: [] sigio_handler+0x5b/0x80
    082579ec: [] sig_handler_common+0x44/0xb0
    08257a68: [] sig_handler+0x38/0x50
    08257a78: [] handle_signal+0x5c/0xa0
    08257a9c: [] hard_handler+0x18/0x20
    08257aac: [] 0xc14400

    Signed-off-by: Will Newton
    Acked-by: WANG Cong
    Cc: Jeff Dike
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Newton
     

18 Nov, 2010

1 commit


12 Nov, 2010

1 commit

  • Both commits 0a3d763f1a68 ("ptrace: cleanup arch_ptrace() on um") and
    9b05a69e0534 ("ptrace: change signature of arch_ptrace()") broke the um
    build. This patch fixes the issues.

    0a3d763f1a68 introduced the undeclared variable "datavp". The patch seems
    completely untested. :-(

    9b05a69e0534 changed arch_ptrace()'s signature but did not update
    um/include/asm/ptrace-generic.h.

    Signed-off-by: Richard Weinberger
    Cc: Namhyung Kim
    Cc: Jeff Dike
    Tested-by: Will Newton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     

29 Oct, 2010

1 commit

  • * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (38 commits)
    kbuild: convert `arch/tile' to the kconfig mainmenu upgrade
    README: cite nconfig
    Revert "kconfig: Temporarily disable dependency warnings"
    kconfig: Use PATH_MAX instead of 128 for path buffer sizes.
    kconfig: Fix realloc usage()
    kconfig: Propagate const
    kconfig: Don't go out from read config loop when you read new symbol
    kconfig: fix menuconfig on debian lenny
    kbuild: migrate all arch to the kconfig mainmenu upgrade
    kconfig: expand file names
    kconfig: use the file's name of sourced file
    kconfig: constify file name
    kconfig: don't emit warning upon rootmenu's prompt redefinition
    kconfig: replace KERNELVERSION usage by the mainmenu's prompt
    kconfig: delay gconf window initialization
    kconfig: expand by default the rootmenu's prompt
    kconfig: add a symbol string expansion helper
    kconfig: regen parser
    kconfig: implement the `mainmenu' directive
    kconfig: allow PACKAGE to be defined on the compiler's command-line
    ...

    Fix up trivial conflict in arch/mn10300/Kconfig

    Linus Torvalds
     

28 Oct, 2010

2 commits

  • Remove unnecessary castings using void pointer and fix copy_to_user()
    return value. Also add missing __user markup on the argument of
    arch_ptrctl().

    Signed-off-by: Namhyung Kim
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • Fix up the arguments to arch_ptrace() to take account of the fact that
    @addr and @data are now unsigned long rather than long as of a preceding
    patch in this series.

    Signed-off-by: Namhyung Kim
    Cc:
    Acked-by: Roland McGrath
    Acked-by: David Howells
    Acked-by: Geert Uytterhoeven
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     

27 Oct, 2010

7 commits

  • This patch removes __do_IRQ() from user mode linux. __do_IRQ is deprecated.

    Signed-off-by: Richard Weinberger
    Cc: Jeff Dike
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • With glibc 2.11 or later that was built with --enable-multi-arch, the UML
    link fails with undefined references to __rel_iplt_start and similar
    symbols. In recent binutils, the default linker script defines these
    symbols (see ld --verbose). Fix the UML linker scripts to match the new
    defaults for these sections.

    Signed-off-by: Roland McGrath
    Cc: Jeff Dike
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • I think that it's better to detect DMA misuse at build time rather than
    calling BUG_ON. Architectures that can't do DMA need to define
    CONFIG_NO_DMA.

    Thanks to Sam Ravnborg for explaining how CONFIG_NO_DMA and CONFIG_HAS_DMA
    work:

    http://marc.info/?l=linux-kernel&m=128359913825550&w=2

    HAS_DMA is defined like this:

    config HAS_DMA
    boolean
    depends on !NO_DMA
    default y

    So to set HAS_DMA to true an arch should do:
    1) Do not define NO_DMA
    2) Define NO_DMA abd set it to 'n'

    Must archs - including um - used principle 1).

    In the um case we want to say that we do NOT have any DMA.
    This can be done in two ways.
    a) define NO_DMA and set it to 'y'
    b) redefine HAS_DMA and set it to 'n'.

    The patch you provided used principle b) where other archs use principle a).
    So I suggest you should use principle a) for um too.

    Signed-off-by: FUJITA Tomonori
    Cc: Miklos Szeredi
    Cc: Jeff Dike
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Since we no longer need to provide KM_type, the whole pte_*map_nested()
    API is now redundant, remove it.

    Signed-off-by: Peter Zijlstra
    Acked-by: Chris Metcalf
    Cc: David Howells
    Cc: Hugh Dickins
    Cc: Rik van Riel
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Steven Rostedt
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: David Miller
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • Commit df9ee292 ("Fix IRQ flag handling naming") changed the IRQ flag
    handling naming scheme and broke UML:

    In file included from arch/um/include/asm/fixmap.h:5,
    from arch/um/include/shared/um_uaccess.h:10,
    from arch/um/include/asm/uaccess.h:41,
    from arch/um/include/asm/thread_info.h:13,
    from include/linux/thread_info.h:56,
    from include/linux/preempt.h:9,
    from include/linux/spinlock.h:50,
    from include/linux/seqlock.h:29,
    from include/linux/time.h:8,
    from include/linux/stat.h:60,
    from include/linux/module.h:10,
    from init/main.c:13:
    arch/um/include/asm/system.h:11:1: warning: "local_save_flags" redefined

    This patch brings the new scheme to UML and makes it work again.

    Signed-off-by: Richard Weinberger
    Acked-by: David Howells
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • The linker script cleanup that I did in commit 5d150a97f93 ("um: Clean up
    linker script using standard macros.") (2.6.32) accidentally introduced an
    ALIGN(PAGE_SIZE) when converting to use INIT_TEXT_SECTION; Richard
    Weinberger reported that this causes the kernel to segfault with
    CONFIG_STATIC_LINK=y.

    I'm not certain why this extra alignment is a problem, but it seems likely
    it is because previously

    __init_begin = _stext = _text = _sinittext

    and with the extra ALIGN(PAGE_SIZE), _sinittext becomes different from the
    rest. So there is likely a bug here where something is assuming that
    _sinittext is the same as one of those other symbols. But reverting the
    accidental change fixes the regression, so it seems worth committing that
    now.

    Signed-off-by: Tim Abbott
    Reported-by: Richard Weinberger
    Cc: Jeff Dike
    Tested by: Antoine Martin
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     
  • This fixes a issue which was introduced by fe2cc53e ("uml: track and make
    up lost ticks").

    timeval_to_ns() returns long long and not int. Due to that UML's timer
    did not work properlt and caused timer freezes.

    Signed-off-by: Richard Weinberger
    Acked-by: Pekka Enberg
    Cc: Jeff Dike
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     

23 Oct, 2010

1 commit

  • * 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    vfs: make no_llseek the default
    vfs: don't use BKL in default_llseek
    llseek: automatically add .llseek fop
    libfs: use generic_file_llseek for simple_attr
    mac80211: disallow seeks in minstrel debug code
    lirc: make chardev nonseekable
    viotape: use noop_llseek
    raw: use explicit llseek file operations
    ibmasmfs: use generic_file_llseek
    spufs: use llseek in all file operations
    arm/omap: use generic_file_llseek in iommu_debug
    lkdtm: use generic_file_llseek in debugfs
    net/wireless: use generic_file_llseek in debugfs
    drm: use noop_llseek

    Linus Torvalds