23 Sep, 2010

1 commit


22 Sep, 2010

2 commits


21 Sep, 2010

1 commit

  • If another cpu does a very wide munmap() on the signal frame area,
    it can tear down the page table hierarchy from underneath us.

    Borrow an idea from the 64-bit fault path's get_user_insn(), and
    disable cross call interrupts during the page table traversal
    to lock them in place while we operate.

    Reported-by: Al Viro
    Signed-off-by: David S. Miller

    David S. Miller
     

15 Sep, 2010

1 commit

  • compat_alloc_user_space() expects the caller to independently call
    access_ok() to verify the returned area. A missing call could
    introduce problems on some architectures.

    This patch incorporates the access_ok() check into
    compat_alloc_user_space() and also adds a sanity check on the length.
    The existing compat_alloc_user_space() implementations are renamed
    arch_compat_alloc_user_space() and are used as part of the
    implementation of the new global function.

    This patch assumes NULL will cause __get_user()/__put_user() to either
    fail or access userspace on all architectures. This should be
    followed by checking the return value of compat_access_user_space()
    for NULL in the callers, at which time the access_ok() in the callers
    can also be removed.

    Reported-by: Ben Hawkes
    Signed-off-by: H. Peter Anvin
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Chris Metcalf
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Acked-by: Thomas Gleixner
    Acked-by: Tony Luck
    Cc: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: James Bottomley
    Cc: Kyle McMartin
    Cc: Martin Schwidefsky
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc:

    H. Peter Anvin
     

13 Sep, 2010

1 commit


11 Sep, 2010

1 commit


09 Sep, 2010

1 commit


29 Aug, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: pxa27x_keypad - remove input_free_device() in pxa27x_keypad_remove()
    Input: mousedev - fix regression of inverting axes
    Input: uinput - add devname alias to allow module on-demand load
    Input: hil_kbd - fix compile error
    USB: drop tty argument from usb_serial_handle_sysrq_char()
    Input: sysrq - drop tty argument form handle_sysrq()
    Input: sysrq - drop tty argument from sysrq ops handlers

    Linus Torvalds
     

25 Aug, 2010

1 commit


24 Aug, 2010

1 commit

  • This is based upon a report by Meelis Roos showing that it's possible
    that we'll try to fetch a property that is 32K in size with some
    devices. With the current fixed 3K buffer we use for moving data in
    and out of the firmware during PROM calls, that simply won't work.

    In fact, it will scramble random kernel data during bootup.

    The reasoning behind the temporary buffer is entirely historical. It
    used to be the case that we had problems referencing dynamic kernel
    memory (including the stack) early in the boot process before we
    explicitly told the firwmare to switch us over to the kernel trap
    table.

    So what we did was always give the firmware buffers that were locked
    into the main kernel image.

    But we no longer have problems like that, so get rid of all of this
    indirect bounce buffering.

    Besides fixing Meelis's bug, this also makes the kernel data about 3K
    smaller.

    It was also discovered during these conversions that the
    implementation of prom_retain() was completely wrong, so that was
    fixed here as well. Currently that interface is not in use.

    Reported-by: Meelis Roos
    Tested-by: Meelis Roos
    Signed-off-by: David S. Miller

    David S. Miller
     

20 Aug, 2010

2 commits


19 Aug, 2010

2 commits


18 Aug, 2010

6 commits

  • Basically tip-off the powerpc code, use a 64-bit type and atomic64_t
    interfaces for the implementation.

    This gets us off of the by-hand asm code I wrote, which frankly I
    think probably ruins I-cache hit rates.

    The idea was the keep the call chains less deep, but anything taking
    the rw-semaphores probably is also calling other stuff and therefore
    already has allocated a stack-frame. So no real stack frame savings
    ever.

    Ben H. has posted patches to make powerpc use 64-bit too and with some
    abstractions we can probably use a shared header file somewhere.

    With suggestions from Sam Ravnborg.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Linus noticed that some of the interface arguments
    didn't get "int" --> "long" conversion, as needed.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc64: Fix atomic64_t routine return values.
    sparc64: Fix rwsem constant bug leading to hangs.
    sparc: Hook up new fanotify and prlimit64 syscalls.
    sparc: Really fix "console=" for serial consoles.

    Linus Torvalds
     
  • Make do_execve() take a const filename pointer so that kernel_execve() compiles
    correctly on ARM:

    arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type

    This also requires the argv and envp arguments to be consted twice, once for
    the pointer array and once for the strings the array points to. This is
    because do_execve() passes a pointer to the filename (now const) to
    copy_strings_kernel(). A simpler alternative would be to cast the filename
    pointer in do_execve() when it's passed to copy_strings_kernel().

    do_execve() may not change any of the strings it is passed as part of the argv
    or envp lists as they are some of them in .rodata, so marking these strings as
    const should be fine.

    Further kernel_execve() and sys_execve() need to be changed to match.

    This has been test built on x86_64, frv, arm and mips.

    Signed-off-by: David Howells
    Tested-by: Ralf Baechle
    Acked-by: Russell King
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Should return 'long' instead of 'int'.

    Thanks to Dimitris Michailidis and Tony Luck.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • As noticed by Linus, it is critical that some of the
    rwsem constants be signed. Yet, hex constants are
    unsigned unless explicitly casted or negated.

    The most critical one is RWSEM_WAITING_BIAS.

    This bug was exacerbated by commit
    424acaaeb3a3932d64a9b4bd59df6cf72c22d8f3 ("rwsem: wake queued readers
    when writer blocks on active read lock")

    Signed-off-by: David S. Miller

    David S. Miller
     

17 Aug, 2010

3 commits

  • The only tricky bit is the compat version of fanotify_mark, which
    which on 32-bit the 64-bit mark argument is passed in as "high32",
    "low32".

    Signed-off-by: David S. Miller

    David S. Miller
     
  • David S. Miller
     
  • If a video head and keyboard are hooked up, specifying "console=ttyS0"
    or similar to use a serial console will not work properly.

    The key issue is that we must register all serial console capable
    devices with register_console(), otherwise the command line specified
    device won't be found. The sun serial drivers would only register
    themselves as console devices if the OpenFirmware specified console
    device node matched. To fix this part we now unconditionally get
    the serial console register by setting serial_drv->cons always.

    Secondarily we must not add_preferred_console() using the firmware
    provided console setting if the user gaven an override on the kernel
    command line using "console=" The "primary framebuffer" matching
    logic was always triggering o n openfirmware device node match, make
    it not when a command line override was given.

    Reported-by: Frans Pop
    Tested-by: Frans Pop
    Signed-off-by: David S. Miller

    David S. Miller
     

15 Aug, 2010

1 commit


14 Aug, 2010

1 commit

  • Mark arguments to certain system calls as being const where they should be but
    aren't. The list includes:

    (*) The filename arguments of various stat syscalls, execve(), various utimes
    syscalls and some mount syscalls.

    (*) The filename arguments of some syscall helpers relating to the above.

    (*) The buffer argument of various write syscalls.

    Signed-off-by: David Howells
    Acked-by: David S. Miller
    Signed-off-by: Linus Torvalds

    David Howells
     

11 Aug, 2010

4 commits

  • Architectures implement dma_is_consistent() in different ways (some
    misinterpret the definition of API in DMA-API.txt). So it hasn't been so
    useful for drivers. We have only one user of the API in tree. Unlikely
    out-of-tree drivers use the API.

    Even if we fix dma_is_consistent() in some architectures, it doesn't look
    useful at all. It was invented long ago for some old systems that can't
    allocate coherent memory at all. It's better to export only APIs that are
    definitely necessary for drivers.

    Let's remove this API.

    Signed-off-by: FUJITA Tomonori
    Cc: James Bottomley
    Reviewed-by: Konrad Rzeszutek Wilk
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • dma_get_cache_alignment returns the minimum DMA alignment. Architectures
    defines it as ARCH_DMA_MINALIGN (formally ARCH_KMALLOC_MINALIGN). So we
    can unify dma_get_cache_alignment implementations.

    Note that some architectures implement dma_get_cache_alignment wrongly.
    dma_get_cache_alignment() should return the minimum DMA alignment. So
    fully-coherent architectures should return 1. This patch also fixes this
    issue.

    Signed-off-by: FUJITA Tomonori
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • * 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
    block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
    xen-blkfront: fix missing out label
    blkdev: fix blkdev_issue_zeroout return value
    block: update request stacking methods to support discards
    block: fix missing export of blk_types.h
    writeback: fix bad _bh spinlock nesting
    drbd: revert "delay probes", feature is being re-implemented differently
    drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
    drbd: Disable delay probes for the upcomming release
    writeback: cleanup bdi_register
    writeback: add new tracepoints
    writeback: remove unnecessary init_timer call
    writeback: optimize periodic bdi thread wakeups
    writeback: prevent unnecessary bdi threads wakeups
    writeback: move bdi threads exiting logic to the forker thread
    writeback: restructure bdi forker loop a little
    writeback: move last_active to bdi
    writeback: do not remove bdi from bdi_list
    writeback: simplify bdi code a little
    writeback: do not lose wake-ups in bdi threads
    ...

    Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
    drivers/scsi/scsi_error.c as per Jens.

    Linus Torvalds
     
  • This patch is against the 2.6.34 source.

    Paraphrased from the 1989 BSD patch by David Borman @ cray.com:

    These are the changes needed for the kernel to support
    LINEMODE in the server.

    There is a new bit in the termios local flag word, EXTPROC.
    When this bit is set, several aspects of the terminal driver
    are disabled. Input line editing, character echo, and mapping
    of signals are all disabled. This allows the telnetd to turn
    off these functions when in linemode, but still keep track of
    what state the user wants the terminal to be in.

    New ioctl:
    TIOCSIG Generate a signal to processes in the
    current process group of the pty.

    There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
    When packet mode is turned on in the pty, and the EXTPROC bit
    is set, then whenever the state of the pty is changed, the
    next read on the master side of the pty will have the TIOCPKT_IOCTL
    bit set. This allows the process on the server side of the pty
    to know when the state of the terminal has changed; it can then
    issue the appropriate ioctl to retrieve the new state.

    Since the original BSD patches accompanied the source code for telnet
    I've left that reference here, but obviously the feature is useful for
    any remote terminal protocol, including ssh.

    The corresponding feature has existed in the BSD tty driver since 1989.
    For historical reference, a good copy of the relevant files can be found
    here:

    http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741

    Signed-off-by: Howard Chu
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    hyc@symas.com
     

10 Aug, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc64: Update defconfig.
    sparc: Kill user copy check code.
    sparc64: Fix perf_arch_get_caller_regs().
    sparc64: Add missing ID to parport probing code.

    Linus Torvalds
     
  • kunmap_atomic() is currently at level -4 on Rusty's "Hard To Misuse"
    list[1] ("Follow common convention and you'll get it wrong"), except in
    some architectures when CONFIG_DEBUG_HIGHMEM is set[2][3].

    kunmap() takes a pointer to a struct page; kunmap_atomic(), however, takes
    takes a pointer to within the page itself. This seems to once in a while
    trip people up (the convention they are following is the one from
    kunmap()).

    Make it much harder to misuse, by moving it to level 9 on Rusty's list[4]
    ("The compiler/linker won't let you get it wrong"). This is done by
    refusing to build if the type of its first argument is a pointer to a
    struct page.

    The real kunmap_atomic() is renamed to kunmap_atomic_notypecheck()
    (which is what you would call in case for some strange reason calling it
    with a pointer to a struct page is not incorrect in your code).

    The previous version of this patch was compile tested on x86-64.

    [1] http://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
    [2] In these cases, it is at level 5, "Do it right or it will always
    break at runtime."
    [3] At least mips and powerpc look very similar, and sparc also seems to
    share a common ancestor with both; there seems to be quite some
    degree of copy-and-paste coding here. The include/asm/highmem.h file
    for these three archs mention x86 CPUs at its top.
    [4] http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html
    [5] As an aside, could someone tell me why mn10300 uses unsigned long as
    the first parameter of kunmap_atomic() instead of void *?

    Signed-off-by: Cesar Eduardo Barros
    Cc: Russell King (arch/arm)
    Cc: Ralf Baechle (arch/mips)
    Cc: David Howells (arch/frv, arch/mn10300)
    Cc: Koichi Yasutake (arch/mn10300)
    Cc: Kyle McMartin (arch/parisc)
    Cc: Helge Deller (arch/parisc)
    Cc: "James E.J. Bottomley" (arch/parisc)
    Cc: Benjamin Herrenschmidt (arch/powerpc)
    Cc: Paul Mackerras (arch/powerpc)
    Cc: "David S. Miller" (arch/sparc)
    Cc: Thomas Gleixner (arch/x86)
    Cc: Ingo Molnar (arch/x86)
    Cc: "H. Peter Anvin" (arch/x86)
    Cc: Arnd Bergmann (include/asm-generic)
    Cc: Rusty Russell ("Hard To Misuse" list)
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cesar Eduardo Barros
     

09 Aug, 2010

4 commits

  • Signed-off-by: David S. Miller

    David S. Miller
     
  • For whatever reason GCC isn't able to figure things out in
    the control flow (in particular when min() and max() expressions
    are involved) on sparc as well as it can on x86.

    So lots of useless incorrect user copy warnings get spewed and the
    full-on compile failure mode of the user copy checks were never usable
    on sparc at all.

    People can debug these kinds of problems on x86.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • After b0f82b81fe6bbcf78d478071f33e44554726bc81 ("perf: Drop the skip
    argument from perf_arch_fetch_regs_caller") the build broke on sparc64
    due to the lack of a module symbol export of __perf_arch_fetch_caller_regs.

    But that assembler helper can actually be complete eliminated now that
    the semantics of this interface have been greatly simplified.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • SunBlade-2500 has 'parallel' device node with compatible
    property "pnpALI,1533,3" so add that to the ID table.

    Reported-by: Mikael Pettersson
    Tested-by: Mikael Pettersson
    Signed-off-by: David S. Miller

    David S. Miller
     

08 Aug, 2010

1 commit


07 Aug, 2010

2 commits

  • …x/kernel/git/tip/linux-2.6-tip

    * 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Fix read_persistent_clock fallout
    kgdb: Do not access xtime directly
    powerpc: Clean up obsolete code relating to decrementer and timebase
    powerpc: Rework VDSO gettimeofday to prevent time going backwards
    clocksource: Add __clocksource_updatefreq_hz/khz methods
    x86: Convert common clocksources to use clocksource_register_hz/khz
    timekeeping: Make xtime and wall_to_monotonic static
    hrtimer: Cleanup direct access to wall_to_monotonic
    um: Convert to use read_persistent_clock
    timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
    powerpc: Cleanup xtime usage
    powerpc: Simplify update_vsyscall
    time: Kill off CONFIG_GENERIC_TIME
    time: Implement timespec_add
    x86: Fix vtime/file timestamp inconsistencies

    Trivial conflicts in Documentation/feature-removal-schedule.txt

    Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
    per Thomas' earlier merge commit 47916be4e28c ("Merge branch
    'powerpc.cherry-picks' into timers/clocksource")

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

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (162 commits)
    tracing/kprobes: unregister_trace_probe needs to be called under mutex
    perf: expose event__process function
    perf events: Fix mmap offset determination
    perf, powerpc: fsl_emb: Restore setting perf_sample_data.period
    perf, powerpc: Convert the FSL driver to use local64_t
    perf tools: Don't keep unreferenced maps when unmaps are detected
    perf session: Invalidate last_match when removing threads from rb_tree
    perf session: Free the ref_reloc_sym memory at the right place
    x86,mmiotrace: Add support for tracing STOS instruction
    perf, sched migration: Librarize task states and event headers helpers
    perf, sched migration: Librarize the GUI class
    perf, sched migration: Make the GUI class client agnostic
    perf, sched migration: Make it vertically scrollable
    perf, sched migration: Parameterize cpu height and spacing
    perf, sched migration: Fix key bindings
    perf, sched migration: Ignore unhandled task states
    perf, sched migration: Handle ignored migrate out events
    perf: New migration tool overview
    tracing: Drop cpparg() macro
    perf: Use tracepoint_synchronize_unregister() to flush any pending tracepoint call
    ...

    Fix up trivial conflicts in Makefile and drivers/cpufreq/cpufreq.c

    Linus Torvalds
     

06 Aug, 2010

1 commit

  • * 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (63 commits)
    of/platform: Register of_platform_drivers with an "of:" prefix
    of/address: Clean up function declarations
    of/spi: call of_register_spi_devices() from spi core code
    of: Provide default of_node_to_nid() implementation.
    of/device: Make of_device_make_bus_id() usable by other code.
    of/irq: Fix endian issues in parsing interrupt specifiers
    of: Fix phandle endian issues
    of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string
    of: remove of_default_bus_ids
    of: make of_find_device_by_node generic
    microblaze: remove references to of_device and to_of_device
    sparc: remove references to of_device and to_of_device
    powerpc: remove references to of_device and to_of_device
    of/device: Replace of_device with platform_device in includes and core code
    of/device: Protect against binding of_platform_drivers to non-OF devices
    of: remove asm/of_device.h
    of: remove asm/of_platform.h
    of/platform: remove all of_bus_type and of_platform_bus_type references
    of: Merge of_platform_bus_type with platform_bus_type
    drivercore/of: Add OF style matching to platform bus
    ...

    Fix up trivial conflicts in arch/microblaze/kernel/Makefile due to just
    some obj-y removals by the devicetree branch, while the microblaze
    updates added a new file.

    Linus Torvalds