14 Feb, 2008

9 commits

  • This comment caused some consternation during fastcall removal. Make it
    truthful.

    Signed-off-by: Paul E. McKenney
    Cc: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul E. McKenney
     
  • FASTCALL() is always expanded to empty, remove it.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Commit d3d74453c34f8fd87674a8cf5b8a327c68f22e99 ("hrtimer: fixup the
    HRTIMER_CB_IRQSAFE_NO_SOFTIRQ fallback") broke several archs, and since
    only Russell bothered to merge the fix, and Greg to ACK his arch, I'm
    sending this for merger.

    I have confirmation that the Alpha bit results in a booting kernel.
    That leaves: blackfin, frv, sh and sparc untested.

    The deadlock in question was found by Russell:

    IRQ handle
    -> timer_tick() - xtime seqlock held for write
    -> update_process_times()
    -> run_local_timers()
    -> hrtimer_run_queues()
    -> hrtimer_get_softirq_time() - tries to get a read lock

    Now, Thomas assures me the fix is trivial, only do_timer() needs to be
    done under the xtime_lock, and update_process_times() can savely be
    removed from under it.

    Signed-off-by: Peter Zijlstra
    Acked-by: Greg Ungerer
    CC: Richard Henderson
    CC: Bryan Wu
    CC: David Howells
    CC: Paul Mundt
    CC: William Irwin
    Acked-by: Ingo Molnar
    Acked-by: Ivan Kokshaysky
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • The raw_pci_read() interface (as the raw_pci_ops->read() before it)
    unconditionally fills in a 32-bit integer return value regardless of the
    size of the operation requested.

    So claiming to take a "void *" is wrong, as is passing in a pointer to
    just a byte variable.

    Noticed by pageexec when enabling -fstack-protector (which needs other
    patches too to actually work, but that's a separate issue).

    Acked-by: Len Brown
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Fix up parse error in FRV linker script, presumably introduced through changes
    to the INIT_TEXT and EXIT_TEXT macros.

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
    sched: rt-group: refure unrunnable tasks
    sched: rt-group: clean up the ifdeffery
    sched: rt-group: make rt groups scheduling configurable
    sched: rt-group: interface
    sched: rt-group: deal with PI
    sched: fix incorrect irq lock usage in normalize_rt_tasks()
    sched: fair-group: separate tg->shares from task_group_lock
    hrtimer: more hrtimer_init_sleeper() fallout.

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
    x86: pit_clockevent can be static
    x86: EFI runtime code mapping enhancement
    x86: EFI: fix use of unitialized variable and the cache logic
    x86: CPA: fix gbpages support in try_preserve_large_page
    xen: unpin initial Xen pagetable once we're finished with it
    x86/early_ioremap: don't assume we're using swapper_pg_dir
    x86: fixup machine_ops reboot_{32|64}.c unification fallout
    x86: fix sigcontext.h user export

    Linus Torvalds
     
  • writel(sock + ...) that should've been writel(sock->addr + ...)

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

    Al Viro
     
  • test_and_set_bit() on address of uint32_t is a Bad Idea(tm)...

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

    Al Viro
     

13 Feb, 2008

18 commits

  • Signed-off-by: Al Viro
    Acked-by: Carlos Corbacho
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • arch/x86/kernel/i8253.c:98:27: warning: symbol 'pit_clockevent' was not declared. Should it be static?

    Signed-off-by: Harvey Harrison
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Harvey Harrison
     
  • This patch enhances EFI runtime code memory mapping as following:

    - Move __supported_pte_mask & _PAGE_NX checking before invoking
    runtime_code_page_mkexec(). This makes it possible for compiler to
    eliminate runtime_code_page_mkexec() on machine without NX support.

    - Use set_memory_x/nx in early_mapping_set_exec(). This eliminates the
    duplicated implementation.

    This patch has been tested on Intel x86_64 platform with EFI64/32
    firmware.

    Signed-off-by: Huang Ying
    Signed-off-by: Ingo Molnar

    Huang, Ying
     
  • Andi Kleen pointed out that the cache attribute logic is reverse in
    efi_enter_virtual_mode(). This problem alone is harmless as we do not
    (yet) do cache attribute conflict resolution. (This bug was not present
    in the original EFI submission - I introduced it while fixing up rejects.)

    While reviewing this code I noticed a second, worse problem: the use of
    uninitialized md->virt_addr.

    Fix both problems.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • [ mingo@elte.hu: while gbpages cannot be enabled on mainline currently,
    keep the code uptodate and this fix is easy enough. ]

    Use correct page sizes and masks for GB pages in try_preserve_large_page()

    This prevents a boot hang on a GB capable system with CONFIG_DIRECT_GBPAGES
    enabled.

    Signed-off-by: Andi Kleen
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Andi Kleen
     
  • Unpin the Xen-provided pagetable once we've finished with it, so it
    doesn't cause stray references which cause later swapper_pg_dir
    pagetable updates to fail.

    Signed-off-by: Jeremy Fitzhardinge
    Tested-by: Jody Belka
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • At the early stages of boot, before the kernel pagetable has been
    fully initialized, a Xen kernel will still be running off the
    Xen-provided pagetables rather than swapper_pg_dir[]. Therefore,
    readback cr3 to determine the base of the pagetable rather than
    assuming swapper_pg_dir[].

    Signed-off-by: Jeremy Fitzhardinge
    Tested-by: Jody Belka
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • When reboot_32.c and reboot_64.c were unified (commit 4d022e35fd...),
    the machine_ops code was broken, leading to xen pvops kernels failing
    to properly halt/poweroff/reboot etc. This fixes that up.

    Signed-off-by: Jody Belka
    Cc: Miguel Boton
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Jody Belka
     
  • Jakub Jelinek reported that some user-space code that relies on
    kernel headers has built dependency on the sigcontext->eip/rip
    register names - which have been unified in commit:

    commit 742fa54a62be6a263df14a553bf832724471dfbe
    Author: H. Peter Anvin
    Date: Wed Jan 30 13:30:56 2008 +0100

    x86: use generic register names in struct sigcontext

    so give the old layout to user-space. This is not particularly
    pretty, but it's an ABI so there's no danger of the two definitions
    getting out of sync.

    Reported-by: Jakub Jelinek
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Refuse to accept or create RT tasks in groups that can't run them.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Clean up some of the excessive ifdeffery introduces in the last patch.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Make the rt group scheduler compile time configurable.
    Keep it experimental for now.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Change the rt_ratio interface to rt_runtime_us, to match rt_period_us.
    This avoids picking a granularity for the ratio.

    Extend the /sys/kernel/uids// interface to allow setting
    the group's rt_runtime.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Steven mentioned the fun case where a lock holding task will be throttled.

    Simple fix: allow groups that have boosted tasks to run anyway.

    If a runnable task in a throttled group gets boosted the dequeue/enqueue
    done by rt_mutex_setprio() is enough to unthrottle the group.

    This is ofcourse not quite correct. Two possible ways forward are:
    - second prio array for boosted tasks
    - boost to a prio ceiling (this would also work for deadline scheduling)

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • lockdep spotted this bogus irq locking. normalize_rt_tasks() can be called
    from hardirq context through sysrq-n

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • On Mon, 2008-02-11 at 15:09 +0300, Denis V. Lunev wrote:
    > BUG: sleeping function called from invalid context
    > at /home/den/src/linux-netns26/kernel/mutex.c:209
    > in_atomic():1, irqs_disabled():0
    > no locks held by swapper/0.
    > Pid: 0, comm: swapper Not tainted 2.6.24 #304
    >
    > Call Trace:
    > [] ? __debug_show_held_locks+0x15/0x27
    > [] __might_sleep+0xc0/0xdf
    > [] mutex_lock_nested+0x28/0x2a9
    > [] sched_destroy_group+0x18/0xea
    > [] sched_destroy_user+0xd/0xf
    > [] free_uid+0x8a/0xab
    > [] __put_task_struct+0x3f/0xd3
    > [] delayed_put_task_struct+0x23/0x25
    > [] __rcu_process_callbacks+0x8d/0x215
    > [] rcu_process_callbacks+0x23/0x44
    > [] __do_softirq+0x79/0xf8
    > [] ? profile_pc+0x2a/0x67
    > [] call_softirq+0x1c/0x30
    > [] do_softirq+0x61/0x9c
    > [] irq_exit+0x51/0x53
    > [] smp_apic_timer_interrupt+0x77/0xad
    > [] apic_timer_interrupt+0x6b/0x70
    > [] ? default_idle+0x43/0x76
    > [] ? default_idle+0x41/0x76
    > [] ? default_idle+0x0/0x76
    > [] ? cpu_idle+0x76/0x98

    separate the tg->shares protection from the task_group lock.

    Reported-by: Denis V. Lunev
    Tested-by: Denis V. Lunev
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Missed an instance...

    futex_lock_pi()
    hrtimer_init_sleeper()
    rt_mutex_timed_lock()
    rt_mutex_timed_fastlock()
    rt_mutex_slowlock()
    hrtimer_start()

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The USEC_TO_HZ and HZ_TO_USEC constant sets were mislabelled, with
    seriously incorrect results. This among other things manifested
    itself as cpufreq not working when a tickless kernel was configured.

    Signed-off-by: H. Peter Anvin
    Tested-by: Carlos R. Mafra
    Signed-off-by: Linus Torvalds

    H. Peter Anvin
     

12 Feb, 2008

13 commits

  • Even if we don't want to register the WMI driver, we should initialize
    the wmi_blocks list to be empty, since we don't want the wmi helper
    functions to oops just because that basic list has not even been set up.

    With this, "find_guid()" will happily return "not found" rather than
    oopsing all over the place, and the callers will then just automatically
    return false or AE_NOT_FOUND as appropriate.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • The makefile magic for installing the 32-bit vdso images on disk had a
    little error. A single-line change would fix that bug, but this does a
    little more to reduce the error-prone duplication of this bit of
    makefile variable magic.

    Signed-off-by: Roland McGrath
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • Kosaki Motohito noted that "numactl --interleave=all ..." failed in the
    presence of memoryless nodes. This patch attempts to fix that problem.

    Some background:

    numactl --interleave=all calls set_mempolicy(2) with a fully populated
    [out to MAXNUMNODES] nodemask. set_mempolicy() [in do_set_mempolicy()]
    calls contextualize_policy() which requires that the nodemask be a
    subset of the current task's mems_allowed; else EINVAL will be returned.

    A task's mems_allowed will always be a subset of node_states[N_HIGH_MEMORY]
    i.e., nodes with memory. So, a fully populated nodemask will be
    declared invalid if it includes memoryless nodes.

    NOTE: the same thing will occur when running in a cpuset
    with restricted mem_allowed--for the same reason:
    node mask contains dis-allowed nodes.

    mbind(2), on the other hand, just masks off any nodes in the nodemask
    that are not included in the caller's mems_allowed.

    In each case [mbind() and set_mempolicy()], mpol_check_policy() will
    complain [again, resulting in EINVAL] if the nodemask contains any
    memoryless nodes. This is somewhat redundant as mpol_new() will remove
    memoryless nodes for interleave policy, as will bind_zonelist()--called
    by mpol_new() for BIND policy.

    Proposed fix:

    1) modify contextualize_policy logic to:
    a) remember whether the incoming node mask is empty.
    b) if not, restrict the nodemask to allowed nodes, as is
    currently done in-line for mbind(). This guarantees
    that the resulting mask includes only nodes with memory.

    NOTE: this is a [benign, IMO] change in behavior for
    set_mempolicy(). Dis-allowed nodes will be
    silently ignored, rather than returning an error.

    c) fold this code into mpol_check_policy(), replace 2 calls to
    contextualize_policy() to call mpol_check_policy() directly
    and remove contextualize_policy().

    2) In existing mpol_check_policy() logic, after "contextualization":
    a) MPOL_DEFAULT: require that in coming mask "was_empty"
    b) MPOL_{BIND|INTERLEAVE}: require that contextualized nodemask
    contains at least one node.
    c) add a case for MPOL_PREFERRED: if in coming was not empty
    and resulting mask IS empty, user specified invalid nodes.
    Return EINVAL.
    c) remove the now redundant check for memoryless nodes

    3) remove the now redundant masking of policy nodes for interleave
    policy from mpol_new().

    4) Now that mpol_check_policy() contextualizes the nodemask, remove
    the in-line nodes_and() from sys_mbind(). I believe that this
    restores mbind() to the behavior before the memoryless-nodes
    patch series. E.g., we'll no longer treat an invalid nodemask
    with MPOL_PREFERRED as local allocation.

    [ Patch history:

    v1 -> v2:
    - Communicate whether or not incoming node mask was empty to
    mpol_check_policy() for better error checking.
    - As suggested by David Rientjes, remove the now unused
    cpuset_nodes_subset_current_mems_allowed() from cpuset.h

    v2 -> v3:
    - As suggested by Kosaki Motohito, fold the "contextualization"
    of policy nodemask into mpol_check_policy(). Looks a little
    cleaner. ]

    Signed-off-by: Lee Schermerhorn
    Signed-off-by: KOSAKI Motohiro
    Tested-by: KOSAKI Motohiro
    Acked-by: David Rientjes
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
    [IA64] Fix build for sim_defconfig

    Linus Torvalds
     
  • So I spent a while pounding my head against my monitor trying to figure
    out the vmsplice() vulnerability - how could a failure to check for
    *read* access turn into a root exploit? It turns out that it's a buffer
    overflow problem which is made easy by the way get_user_pages() is
    coded.

    In particular, "len" is a signed int, and it is only checked at the
    *end* of a do {} while() loop. So, if it is passed in as zero, the loop
    will execute once and decrement len to -1. At that point, the loop will
    proceed until the next invalid address is found; in the process, it will
    likely overflow the pages array passed in to get_user_pages().

    I think that, if get_user_pages() has been asked to grab zero pages,
    that's what it should do. Thus this patch; it is, among other things,
    enough to block the (already fixed) root exploit and any others which
    might be lurking in similar code. I also think that the number of pages
    should be unsigned, but changing the prototype of this function probably
    requires some more careful review.

    Signed-off-by: Jonathan Corbet
    Signed-off-by: Linus Torvalds

    Jonathan Corbet
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    mlx4_core: Fix build break (missing include)

    Linus Torvalds
     
  • Matt is already the maintainer of SLOB which is one of the "SLAB" allocators in
    the kernel so add him to MAINTAINERS.

    Signed-off-by: Pekka Enberg
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • * 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    sata_mv: platform driver allocs dma without create
    pata_ninja32: setup changes
    pata_legacy: typo fix
    pata_amd: Note in the module description it handles Nvidia
    sata_mv: fix loop with last port
    libata: ignore deverr on SETXFER if mode is configured
    pata_via: fix SATA cable detection on cx700

    Linus Torvalds
     
  • This avoids warnings with unreferenced variables in the !NUMA case.

    Signed-off-by: Andi Kleen
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • Commit 313abe55 ("mlx4_core: For 64-bit systems, vmap() kernel queue
    buffers") caused this to pop up on powerpc allyesconfig, looks like a
    missing include file:

    drivers/net/mlx4/alloc.c: In function 'mlx4_buf_alloc':
    drivers/net/mlx4/alloc.c:162: error: implicit declaration of function 'vmap'
    drivers/net/mlx4/alloc.c:162: error: 'VM_MAP' undeclared (first use in this function)
    drivers/net/mlx4/alloc.c:162: error: (Each undeclared identifier is reported only once
    drivers/net/mlx4/alloc.c:162: error: for each function it appears in.)
    drivers/net/mlx4/alloc.c:162: warning: assignment makes pointer from integer without a cast
    drivers/net/mlx4/alloc.c: In function 'mlx4_buf_free':
    drivers/net/mlx4/alloc.c:187: error: implicit declaration of function 'vunmap'

    Signed-off-by: Olof Johansson
    Signed-off-by: Roland Dreier

    Olof Johansson
     
  • Commit bdc807871d58285737d50dc6163d0feb72cb0dc2 broke the build
    for this config because the sim_defconfig selects CONFIG_HZ=250
    but include/asm-ia64/param.h has an ifdef for the simulator to
    force HZ to 32. So we ended up with a kernel/timeconst.h set
    for HZ=250 ... which then failed the check for the right HZ
    value and died with:

    Drop the #ifdef magic from param.h and make force CONFIG_HZ=32
    directly for the simulator.

    Signed-off-by: Tony Luck

    Tony Luck
     
  • When the sata_mv driver is used as a platform driver,
    mv_create_dma_pools() is never called so it fails when trying
    to alloc in mv_pool_start().

    Signed-off-by: Byron Bradley
    Acked-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Byron Bradley
     
  • Forcibly set more of the configuration at init time. This seems to fix at
    least one problem reported. We don't know what most of these bits do, but
    we do know what windows stuffs there.

    Signed-off-by: Alan Cox
    Signed-off-by: Jeff Garzik

    Alan Cox