27 Jan, 2009

6 commits

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

    * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    debugobjects: add and use INIT_WORK_ON_STACK
    rcu: remove duplicate CONFIG_RCU_CPU_STALL_DETECTOR
    relay: fix lock imbalance in relay_late_setup_files
    oprofile: fix uninitialized use of struct op_entry
    rcu: move Kconfig menu
    softlock: fix false panic which can occur if softlockup_thresh is reduced
    rcu: add __cpuinit to rcu_init_percpu_data()

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

    * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    hrtimers: fix inconsistent lock state on resume in hres_timers_resume
    time-sched.c: tick_nohz_update_jiffies should be static
    locking, hpet: annotate false positive warning
    kernel/fork.c: unused variable 'ret'
    itimers: remove the per-cpu-ish-ness

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

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (29 commits)
    xen: unitialised return value in xenbus_write_transaction
    x86: fix section mismatch warning
    x86: unmask CPUID levels on Intel CPUs, fix
    x86: work around PAGE_KERNEL_WC not getting WC in iomap_atomic_prot_pfn.
    x86: use standard PIT frequency
    xen: handle highmem pages correctly when shrinking a domain
    x86, mm: fix pte_free()
    xen: actually release memory when shrinking domain
    x86: unmask CPUID levels on Intel CPUs
    x86: add MSR_IA32_MISC_ENABLE bits to <asm/msr-index.h>
    x86: fix PTE corruption issue while mapping RAM using /dev/mem
    x86: mtrr fix debug boot parameter
    x86: fix page attribute corruption with cpa()
    Revert "x86: signal: change type of paramter for sys_rt_sigreturn()"
    x86: use early clobbers in usercopy*.c
    x86: remove kernel_physical_mapping_init() from init section
    fix: crash: IP: __bitmap_intersects+0x48/0x73
    cpufreq: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write
    work_on_cpu: Use our own workqueue.
    work_on_cpu: don't try to get_online_cpus() in work_on_cpu.
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
    drivers/ide/palm_bk3710.c buildfix
    ide: fix Falcon IDE breakage
    ide: fix IDE PMAC breakage

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    Long btree pointers are still 64 bit on disk
    [XFS] Remove the rest of the macro-to-function indirections.
    xfs: sanity check attr fork size
    xfs: fix bad_features2 fixups for the root filesystem
    xfs: add a lock class for group/project dquots
    xfs: lockdep annotations for xfs_dqlock2
    xfs: add a separate lock class for the per-mount list of dquots
    xfs: use mnt_want_write in compat_attrmulti ioctl
    xfs: fix dentry aliasing issues in open_by_handle

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ASoC: Add missing comma to SND_SOC_DAPM_SWITCH_E in soc-dapm.h
    ALSA: hda: Add STAC92HD83XXX_PWR_REF quirk
    ALSA: hda: revert change to 92hd83xxx power mapping
    ALSA: hda - Add model entry for HP dv4
    ALSA: hda: 83xxx port 0xe DAC selection
    ASoC: fix registration of the SoC card in the Freescale MPC8610 drivers
    sound: virtuoso: document HDAV1.3 driver status
    sound: virtuoso: add newline
    sound: virtuoso: enable UART on Xonar HDAV1.3
    sound: Remove removed OSS kernel parameters from doc
    ALSA: hda: fix invalid power mapping masks
    ASoC: atmel_pcm: Remove non-existant header
    ALSA: hda - add quirks for some 82801H variants to use ALC883_MITAC
    ALSA: hda - Fix (yet more) STAC925x issues

    Linus Torvalds
     

26 Jan, 2009

4 commits

  • The return value of xenbus_write_transaction can be uninitialised in
    the success case leading to the userspace xenstore utilities failing.

    Signed-off-by: Ian Campbell
    Signed-off-by: Ingo Molnar

    Ian Campbell
     
  • Here function vmi_activate calls a init function activate_vmi , which
    causes the following section mismatch warnings:

    LD arch/x86/kernel/built-in.o
    WARNING: arch/x86/kernel/built-in.o(.text+0x13ba9): Section mismatch
    in reference from the function vmi_activate() to the function
    .init.text:vmi_time_init()
    The function vmi_activate() references
    the function __init vmi_time_init().
    This is often because vmi_activate lacks a __init
    annotation or the annotation of vmi_time_init is wrong.

    WARNING: arch/x86/kernel/built-in.o(.text+0x13bd1): Section mismatch
    in reference from the function vmi_activate() to the function
    .devinit.text:vmi_time_bsp_init()
    The function vmi_activate() references
    the function __devinit vmi_time_bsp_init().
    This is often because vmi_activate lacks a __devinit
    annotation or the annotation of vmi_time_bsp_init is wrong.

    WARNING: arch/x86/kernel/built-in.o(.text+0x13bdb): Section mismatch
    in reference from the function vmi_activate() to the function
    .devinit.text:vmi_time_ap_init()
    The function vmi_activate() references
    the function __devinit vmi_time_ap_init().
    This is often because vmi_activate lacks a __devinit
    annotation or the annotation of vmi_time_ap_init is wrong.

    Fix it by marking vmi_activate() as __init too.

    Signed-off-by: Rakib Mullick
    Signed-off-by: Ingo Molnar

    Rakib Mullick
     
  • Impact: fix boot hang on pre-model-15 Intel CPUs

    rdmsrl_safe() does not work in very early bootup code yet, because we
    dont have the pagefault handler installed yet so exception section
    does not get parsed. rdmsr_safe() will just crash and hang the bootup.

    So limit the MSR_IA32_MISC_ENABLE MSR read to those CPU types that
    support it.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • In the absence of PAT, PAGE_KERNEL_WC ends up mapping to a memory type that
    gets UC behavior even in the presence of a WC MTRR covering the area in
    question. By swapping to PAGE_KERNEL_UC_MINUS, we can get the actual
    behavior the caller wanted (WC if you can manage it, UC otherwise).

    This recovers the 40% performance improvement of using WC in the DRM
    to upload vertex data.

    Signed-off-by: Eric Anholt
    Signed-off-by: H. Peter Anvin

    Eric Anholt
     

25 Jan, 2009

1 commit

  • the RDC and ELAN platforms use slighly different PIT clocks, resulting in
    a timex.h hack that changes PIT_TICK_RATE during build time. But if a
    tester enables any of these platform support .config options, the PIT
    will be miscalibrated on standard PC platforms.

    So use one frequency - in a subsequent patch we'll add a quirk to allow
    x86 platforms to define different PIT frequencies.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

24 Jan, 2009

3 commits

  • Commit 1058a75f07b9bb8323fb5197be5526220f8b75cf ("xen: actually release
    memory when shrinking domain") causes a crash if the page being released
    is a highmem page.

    If a page is highmem then there is no need to unmap it.

    Signed-off-by: Ian Campbell
    Acked-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Ian Campbell
     
  • On -rt we were seeing spurious bad page states like:

    Bad page state in process 'firefox'
    page:c1bc2380 flags:0x40000000 mapping:c1bc2390 mapcount:0 count:0
    Trying to fix it up, but a reboot is needed
    Backtrace:
    Pid: 503, comm: firefox Not tainted 2.6.26.8-rt13 #3
    [] ? printk+0x14/0x19
    [] bad_page+0x4e/0x79
    [] free_hot_cold_page+0x5b/0x1d3
    [] free_hot_page+0xf/0x11
    [] __free_pages+0x20/0x2b
    [] __pte_alloc+0x87/0x91
    [] handle_mm_fault+0xe4/0x733
    [] ? rt_mutex_down_read_trylock+0x57/0x63
    [] ? rt_mutex_down_read_trylock+0x57/0x63
    [] do_page_fault+0x36f/0x88a

    This is the case where a concurrent fault already installed the PTE and
    we get to free the newly allocated one.

    This is due to pgtable_page_ctor() doing the spin_lock_init(&page->ptl)
    which is overlaid with the {private, mapping} struct.

    union {
    struct {
    unsigned long private;
    struct address_space *mapping;
    };
    spinlock_t ptl;
    struct kmem_cache *slab;
    struct page *first_page;
    };

    Normally the spinlock is small enough to not stomp on page->mapping, but
    PREEMPT_RT=y has huge 'spin'locks.

    But lockdep kernels should also be able to trigger this splat, as the
    lock tracking code grows the spinlock to cover page->mapping.

    The obvious fix is calling pgtable_page_dtor() like the regular pte free
    path __pte_free_tlb() does.

    It seems all architectures except x86 and nm10300 already do this, and
    nm10300 doesn't seem to use pgtable_page_ctor(), which suggests it
    doesn't do SMP or simply doesnt do MMU at all or something.

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

    Peter Zijlstra
     
  • Takashi Iwai
     

23 Jan, 2009

6 commits


22 Jan, 2009

8 commits

  • Added model=hp-dv5 for HP dv4 (103c:30f7).

    Reference: kernel bug #12440
    http://bugzilla.kernel.org/show_bug.cgi?id=12440

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Thomas Gleixner
     
  • Impact: Fix debugobjects warning

    debugobject enabled kernels spit out a warning in hpet code due to a
    workqueue which is initialized on stack.

    Add INIT_WORK_ON_STACK() which calls init_timer_on_stack() and use it
    in hpet.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Impact: remove the old CONFIG_RCU_CPU_STALL_DETECTOR

    tree_rcu introduce CONFIG_RCU_CPU_STALL_DETECTOR again.

    These two are the same exactly except:

    the old one "depends on CLASSIC_RCU"
    the new one "depends on CLASSIC_RCU || TREE_RCU"

    This patch remove the old one.

    Signed-off-by: Lai Jiangshan
    Signed-off-by: Ingo Molnar

    Lai Jiangshan
     
  • Impact: Fixes crashes with misconfigured BIOSes on XSAVE hardware

    Avuton Olrich reported early boot crashes with v2.6.28 and
    bisected it down to dc1e35c6e95e8923cf1d3510438b63c600fee1e2
    ("x86, xsave: enable xsave/xrstor on cpus with xsave support").

    If the CPUID limit bit in MSR_IA32_MISC_ENABLE is set, clear it to
    make all CPUID information available. This is required for some
    features to work, in particular XSAVE.

    Reported-and-bisected-by: Avuton Olrich
    Tested-by: Avuton Olrich
    Signed-off-by: H. Peter Anvin

    H. Peter Anvin
     
  • [XFS] Long btree pointers are still 64 bit on disk

    On 32 bit machines with CONFIG_LBD=n, XFS reduces the
    in memory size of xfs_fsblock_t to 32 bits so that it
    will fit within 32 bit addressing. However, the disk format
    for long btree pointers are still 64 bits in size.

    The recent btree rewrite failed to take this into account
    when initialising new btree blocks, setting sibling pointers
    to NULL and checking if they are NULL. Hence checking whether
    a 64 bit NULL was the same as a 32 bit NULL was failingi
    resulting in NULL sibling pointers failing to be detected
    correctly. This showed up as WANT_CORRUPTED_GOTO shutdowns
    in xfs_btree_delrec.

    Fix this by making all the comparisons and setting of long
    pointer btree NULL blocks to the disk format, not the
    in memory format. i.e. use NULLDFSBNO.

    Reported-by: Alexander Beregalov
    Reported-by: Jacek Luczak
    Reported-by: Danny ter Haar
    Tested-by: Jacek Luczak
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Dave Chinner
    Signed-off-by: Felix Blyakher

    Dave Chinner
     
  • Impact: None (new bit definitions currently unused)

    Add bit definitions for the MSR_IA32_MISC_ENABLE MSRs to
    .

    Signed-off-by: H. Peter Anvin

    H. Peter Anvin
     
  • Beschorner Daniel reported:
    > hwinfo problem since 2.6.28, showing this in the oops:
    > Corrupted page table at address 7fd04de3ec00

    Also, PaX Team reported a regression with this commit:

    > commit 9542ada803198e6eba29d3289abb39ea82047b92
    > Author: Suresh Siddha
    > Date: Wed Sep 24 08:53:33 2008 -0700
    >
    > x86: track memtype for RAM in page struct

    This commit breaks mapping any RAM page through /dev/mem, as the
    reserve_memtype() was not initializing the return attribute type and as such
    corrupting the PTE entry that was setup with the return attribute type.

    Because of this bug, application mapping this RAM page through /dev/mem
    will die with "Corrupted page table at address xxxx" message in the kernel
    log and also the kernel identity mapping which maps the underlying RAM
    page gets converted to UC.

    Fix this by initializing the return attribute type before calling
    reserve_ram_pages_type()

    Reported-by: PaX Team
    Reported-and-tested-by: Beschorner Daniel
    Tested-and-Acked-by: PaX Team
    Signed-off-by: Suresh Siddha
    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     

21 Jan, 2009

6 commits

  • while looking at:

    http://bugzilla.kernel.org/show_bug.cgi?id=11541

    I realized that the mtrr.show param cannot work, because
    the code is processed much too early.

    This patch:
    - Declares mtrr.show as early_param
    - Stays consistent with the previous param (which I doubt
    that it ever worked), so mtrr.show=1 would still work
    - Declares mtrr_show as initdata

    Signed-off-by: Thomas Renninger
    Acked-by: Jan Beulich
    Signed-off-by: Ingo Molnar

    Thomas Renninger
     
  • Impact: fix sporadic slowdowns and warning messages

    This patch fixes a performance issue reported by Linus on his
    Nehalem system. While Linus reverted the PAT patch (commit
    58dab916dfb57328d50deb0aa9b3fc92efa248ff) which exposed the issue,
    existing cpa() code can potentially still cause wrong(page attribute
    corruption) behavior.

    This patch also fixes the "WARNING: at arch/x86/mm/pageattr.c:560" that
    various people reported.

    In 64bit kernel, kernel identity mapping might have holes depending
    on the available memory and how e820 reports the address range
    covering the RAM, ACPI, PCI reserved regions. If there is a 2MB/1GB hole
    in the address range that is not listed by e820 entries, kernel identity
    mapping will have a corresponding hole in its 1-1 identity mapping.

    If cpa() happens on the kernel identity mapping which falls into these holes,
    existing code fails like this:

    __change_page_attr_set_clr()
    __change_page_attr()
    returns 0 because of if (!kpte). But doesn't
    set cpa->numpages and cpa->pfn.
    cpa_process_alias()
    uses uninitialized cpa->pfn (random value)
    which can potentially lead to changing the page
    attribute of kernel text/data, kernel identity
    mapping of RAM pages etc. oops!

    This bug was easily exposed by another PAT patch which was doing
    cpa() more often on kernel identity mapping holes (physical range between
    max_low_pfn_mapped and 4GB), where in here it was setting the
    cache disable attribute(PCD) for kernel identity mappings aswell.

    Fix cpa() to handle the kernel identity mapping holes. Retain
    the WARN() for cpa() calls to other not present address ranges
    (kernel-text/data, ioremap() addresses)

    Signed-off-by: Suresh Siddha
    Signed-off-by: Venkatesh Pallipadi
    Cc:
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     
  • This reverts commit 4217458dafaa57d8e26a46f5d05ab8c53cf64191.

    Justin Madru bisected this commit, it was causing weird Firefox
    crashes.

    The reason is that GCC mis-optimizes (re-uses) the on-stack parameters of
    the calling frame, which corrupts the syscall return pt_regs state and
    thus corrupts user-space register state.

    So we go back to the slightly less clean but more optimization-safe
    method of getting to pt_regs. Also add a comment to explain this.

    Resolves: http://bugzilla.kernel.org/show_bug.cgi?id=12505

    Reported-and-bisected-by: Justin Madru
    Tested-by: Justin Madru
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: fix rare (but currently harmless) miscompile with certain configs and gcc versions

    Hugh Dickins noticed that strncpy_from_user() was miscompiled
    in some circumstances with gcc 4.3.

    Thanks to Hugh's excellent analysis it was easy to track down.

    Hugh writes:

    > Try building an x86_64 defconfig 2.6.29-rc1 kernel tree,
    > except not quite defconfig, switch CONFIG_PREEMPT_NONE=y
    > and CONFIG_PREEMPT_VOLUNTARY off (because it expands a
    > might_fault() there, which hides the issue): using a
    > gcc 4.3.2 (I've checked both openSUSE 11.1 and Fedora 10).
    >
    > It generates the following:
    >
    > 0000000000000000 :
    > 0: 48 89 d1 mov %rdx,%rcx
    > 3: 48 85 c9 test %rcx,%rcx
    > 6: 74 0e je 16
    > 8: ac lods %ds:(%rsi),%al
    > 9: aa stos %al,%es:(%rdi)
    > a: 84 c0 test %al,%al
    > c: 74 05 je 13
    > e: 48 ff c9 dec %rcx
    > 11: 75 f5 jne 8
    > 13: 48 29 c9 sub %rcx,%rcx
    > 16: 48 89 c8 mov %rcx,%rax
    > 19: c3 retq
    >
    > Observe that "sub %rcx,%rcx; mov %rcx,%rax", whereas gcc 4.2.1
    > (and many other configs) say "sub %rcx,%rdx; mov %rdx,%rax".
    > Isn't it returning 0 when it ought to be returning strlen?

    The asm constraints for the strncpy_from_user() result were missing an
    early clobber, which tells gcc that the last output arguments
    are written before all input arguments are read.

    Also add more early clobbers in the rest of the file and fix 32-bit
    usercopy.c in the same way.

    Signed-off-by: Andi Kleen
    Signed-off-by: H. Peter Anvin
    [ since this API is rarely used and no in-kernel user relies on a 'len'
    return value (they only rely on negative return values) this miscompile
    was never noticed in the field. But it's worth fixing it nevertheless. ]
    Signed-off-by: Ingo Molnar

    Andi Kleen
     
  • On the 92hd8xxx codecs port 0xe needs the connection selected to be the
    last DAC in the list.

    Signed-off-by: Matthew Ranostay
    Signed-off-by: Takashi Iwai

    Matthew Ranostay
     
  • The Freescale MPC8610 driver was defining two SOC card (snd_soc_card)
    structures, partially initializing each one, but registering only one of
    them with ASoC.

    Signed-off-by: Timur Tabi
    Signed-off-by: Mark Brown

    Timur Tabi
     

20 Jan, 2009

5 commits

  • Impact: fix crash with memory hotplug enabled

    kernel_physical_mapping_init() is called during memory hotplug
    so it does not belong in the init section.

    If the kernel is built with CONFIG_DEBUG_SECTION_MISMATCH=y on
    the make command line, arch/x86/mm/init_64.c is compiled with
    the -fno-inline-functions-called-once gcc option defeating
    inlining of kernel_physical_mapping_init() within init_memory_mapping().

    When kernel_physical_mapping_init() is not inlined it is placed
    in the .init.text section according to the __init in it's current
    declaration. A later call to kernel_physical_mapping_init() during
    a memory hotplug operation encounters an int3 trap because the
    .init.text section memory has been freed.

    This patch eliminates the crash caused by the int3 trap by moving the
    non-inlined kernel_physical_mapping_init() from .init.text to .meminit.text.

    Signed-off-by: Gary Hade
    Signed-off-by: Ingo Molnar

    Gary Hade
     
  • -tip testing found this crash:

    > [ 35.258515] calling acpi_cpufreq_init+0x0/0x127 @ 1
    > [ 35.264127] BUG: unable to handle kernel NULL pointer dereference at (null)
    > [ 35.267554] IP: [] __bitmap_intersects+0x48/0x73
    > [ 35.267554] PGD 0
    > [ 35.267554] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC

    arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c is still broken: there's no
    allocation of the variable mask, so we pass in an uninitialized cmd.mask
    field to drv_read(), which then passes it to the scheduler which then
    crashes ...

    Switch it over to the much simpler constant-cpumask-pointers approach.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: use new work_on_cpu function to reduce stack usage

    Replace the saving of current->cpus_allowed and set_cpus_allowed_ptr() with
    a work_on_cpu function for drv_read() and drv_write().

    Basically converts do_drv_{read,write} into "work_on_cpu" functions that
    are now called by drv_read and drv_write.

    Note: This patch basically reverts 50c668d6 which reverted 7503bfba, now
    that the work_on_cpu() function is more stable.

    Signed-off-by: Mike Travis
    Acked-by: Rusty Russell
    Tested-by: Dieter Ries
    Tested-by: Maciej Rutecki
    Cc: Dave Jones
    Cc:

    Signed-off-by: Ingo Molnar

    Mike Travis
     
  • Impact: remove potential clashes with generic kevent workqueue

    Annoyingly, some places we want to use work_on_cpu are already in
    workqueues. As per Ingo's suggestion, we create a different workqueue
    for work_on_cpu.

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Rusty Russell
     
  • Impact: remove potential circular lock dependency with cpu hotplug lock

    This has caused more problems than it solved, with a pile of cpu
    hotplug locking issues.

    Followup patches will get_online_cpus() in callers that need it, but
    if they don't do it they're no worse than before when they were using
    set_cpus_allowed without locking.

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Rusty Russell
     

19 Jan, 2009

1 commit