03 Jul, 2011

5 commits

  • The unwinder backlink in interrupt entry is very useless.
    It's actually not part of the stack frame chain and thus is
    never used.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Jan Beulich

    Frederic Weisbecker
     
  • Just for clarity in the code. Have a first block that handles
    the frame pointer and a separate one that handles pt_regs
    pointer and its use.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Jan Beulich

    Frederic Weisbecker
     
  • The save_regs function that saves the regs on low level
    irq entry is complicated because of the fact it changes
    its stack in the middle and also because it manipulates
    data allocated in the caller frame and accesses there
    are directly calculated from callee rsp value with the
    return address in the middle of the way.

    This complicates the static stack offsets calculation and
    require more dynamic ones. It also needs a save/restore
    of the function's return address.

    To simplify and optimize this, turn save_regs() into a
    macro.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Jan Beulich

    Frederic Weisbecker
     
  • When regs are passed to dump_stack(), we fetch the frame
    pointer from the regs but the stack pointer is taken from
    the current frame.

    Thus the frame and stack pointers may not come from the same
    context. For example this can result in the unwinder to
    think the context is in irq, due to the current value of
    the stack, but the frame pointer coming from the regs points
    to a frame from another place. It then tries to fix up
    the irq link but ends up dereferencing a random frame
    pointer that doesn't belong to the irq stack:

    [ 9131.706906] ------------[ cut here ]------------
    [ 9131.707003] WARNING: at arch/x86/kernel/dumpstack_64.c:129 dump_trace+0x2aa/0x330()
    [ 9131.707003] Hardware name: AMD690VM-FMH
    [ 9131.707003] Perf: bad frame pointer = 0000000000000005 in callchain
    [ 9131.707003] Modules linked in:
    [ 9131.707003] Pid: 1050, comm: perf Not tainted 3.0.0-rc3+ #181
    [ 9131.707003] Call Trace:
    [ 9131.707003] [] warn_slowpath_common+0x7a/0xb0
    [ 9131.707003] [] warn_slowpath_fmt+0x41/0x50
    [ 9131.707003] [] ? bad_to_user+0x6d/0x10be
    [ 9131.707003] [] dump_trace+0x2aa/0x330
    [ 9131.707003] [] ? native_sched_clock+0x13/0x50
    [ 9131.707003] [] perf_callchain_kernel+0x54/0x70
    [ 9131.707003] [] perf_prepare_sample+0x19f/0x2a0
    [ 9131.707003] [] __perf_event_overflow+0x16c/0x290
    [ 9131.707003] [] ? __perf_event_overflow+0x130/0x290
    [ 9131.707003] [] ? native_sched_clock+0x13/0x50
    [ 9131.707003] [] ? sched_clock+0x9/0x10
    [ 9131.707003] [] ? T.375+0x15/0x90
    [ 9131.707003] [] ? trace_hardirqs_on_caller+0x64/0x180
    [ 9131.707003] [] ? trace_hardirqs_off+0xd/0x10
    [ 9131.707003] [] perf_event_overflow+0x14/0x20
    [ 9131.707003] [] perf_swevent_hrtimer+0x11c/0x130
    [ 9131.707003] [] ? error_exit+0x51/0xb0
    [ 9131.707003] [] __run_hrtimer+0x83/0x1e0
    [ 9131.707003] [] ? perf_event_overflow+0x20/0x20
    [ 9131.707003] [] hrtimer_interrupt+0x106/0x250
    [ 9131.707003] [] ? trace_hardirqs_off_thunk+0x3a/0x3c
    [ 9131.707003] [] smp_apic_timer_interrupt+0x53/0x90
    [ 9131.707003] [] apic_timer_interrupt+0x13/0x20
    [ 9131.707003] [] ? error_exit+0x51/0xb0
    [ 9131.707003] [] ? error_exit+0x4c/0xb0
    [ 9131.707003] ---[ end trace b2560d4876709347 ]---

    Fix this by simply taking the stack pointer from regs->sp
    when regs are provided.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo

    Frederic Weisbecker
     
  • In order to prepare for fetching the stack pointer from the
    regs when possible in dump_trace() instead of taking the
    local one, save the current stack pointer in perf live regs saving.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo

    Frederic Weisbecker
     

14 Jun, 2011

3 commits

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

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of irqs
    kprobes/trace: Fix kprobe selftest for gcc 4.6
    ftrace: Fix possible undefined return code
    oprofile, dcookies: Fix possible circular locking dependency
    oprofile: Fix locking dependency in sync_start()
    oprofile: Free potentially owned tasks in case of errors
    oprofile, x86: Add comments to IBS LVT offset initialization

    Linus Torvalds
     
  • …rnel.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:
    x86: devicetree: Add missing early_init_dt_setup_initrd_arch stub
    x86: cpu-hotplug: Prevent softirq wakeup on wrong CPU

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Prevent potential NULL dereference in irq_set_irq_wake()

    Linus Torvalds
     
  • …git/kgene/linux-samsung

    * 's5p-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
    ARM: S3C2410: remove the now empty mach-s3c2410/irq.c
    ARM: S3C24XX: Move s3c24xx_irq_syscore_ops to plat-s3c24xx/irq.c
    ARM: S3C24xx: Fix missing struct for s3c2410_dma_chan
    ARM: SAMSUNG: Remove unused onenand plat functions
    ARM: EXYNOS4: Remove compiler warning on exynos4_pwm4_resume
    ARM: S5P: Fix compilation error for exynos4_defconfig
    ARM: S5P: Should be S3C_VA_USB_HSPHY instead of S5P_VA_XX
    ARM: S5P64X0: Fix SPI platform device name
    ARM: S5PV210: Fix possible null pointer dereference

    Linus Torvalds
     

13 Jun, 2011

2 commits

  • * 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6:
    gpio/basic_mmio: add missing include of spinlock_types.h
    gpio/nomadik: fix sleepmode for elder Nomadik

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (55 commits)
    ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()
    netpoll: call dev_put() on error in netpoll_setup()
    net: ep93xx_eth: fix DMA API violations
    net: ep93xx_eth: drop GFP_DMA from call to dma_alloc_coherent()
    net: ep93xx_eth: allocate buffers using kmalloc()
    net: ep93xx_eth: pass struct device to DMA API functions
    ep93xx: set DMA masks for the ep93xx_eth
    vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check
    dl2k: EEPROM CRC calculation wrong endianess on bigendian machine
    NET: am79c961: fix assembler warnings
    NET: am79c961: ensure multicast filter is correctly set at open
    NET: am79c961: ensure asm() statements are marked volatile
    ethtool.h: fix typos
    ep93xx_eth: Update MAINTAINERS
    ipv4: Fix packet size calculation for raw IPsec packets in __ip_append_data
    netpoll: prevent netpoll setup on slave devices
    net: pmtu_expires fixes
    gianfar:localized filer table
    iwlegacy: fix channel switch locking
    mac80211: fix IBSS teardown race
    ...

    Linus Torvalds
     

12 Jun, 2011

1 commit


10 Jun, 2011

7 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc32, leon: bugfix in LEON SMP interrupt init
    sparc32, sun4m: bugfix in SMP IPI traphandler
    sparc: Remove unnecessary semicolons
    Add support for allocating irqs for bootbus devices
    Do not skip interrupt sources in sun4d interrupt handler and acknowledge interrupts correctly
    Restructure sun4d_build_device_irq so that timer interrupts can be allocated
    sparc: PCIC_PCI needs SPARC32 dependency
    sparc: Do not select GENERIC_HARDIRQS_NO_DEPRECATED
    sparc32,leon: add GRPCI2 PCI Host driver
    sparc32,leon: added LEON-common low-level PCI routines
    sparc32: added CONFIG_PCIC_PCI Kconfig setting

    Linus Torvalds
     
  • During converting per-cpu ticker to genirq layer some
    IRQ initialization code was removed by commit
    2cf9530420e446bb61f665d02afeb81070106900 ("sparc32,leon:
    per-cpu ticker use genirq per-cpu handler").

    This patch reintroduces the code at the same place it was
    removed from. IRQ12 - IRQ14 will crash on LEON SMP without
    this patch because it will run the SUN4M IRQ trap handler.

    Reported-by: Jan Andersson
    Signed-off-by: Daniel Hellstrom
    Signed-off-by: David S. Miller

    Daniel Hellstrom
     
  • Three new IPIs were introduced by commit
    ecbc42b70acbc6327adefe9635db93fcf62bf59d ("sparc32, sun4m:
    Implemented SMP IPIs support for SUN4M machines"), the
    old handler was already prepared for IPIs but handled only
    IRQ14 and IRQ13, this patch adds support for the new IPI at
    IRQ12.

    The IPI trap handler looks at the mask rather than the
    pending IRQ/IPI, this bug may have masked the problem
    above, introduced by the same commit.

    Signed-off-by: Daniel Hellstrom
    Signed-off-by: David S. Miller

    Daniel Hellstrom
     
  • The mach-nomadik machine did not compile properly due to bad
    ux500-specific functions being called. Introduce new state
    variables to fix this up.

    Reported-by: Axel Lin
    Cc: Alessandro Rubini
    Cc: Prafulla Wadaskar
    Signed-off-by: Linus Walleij
    Signed-off-by: Grant Likely

    Linus Walleij
     
  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
    powerpc: Force page alignment for initrd reserved memory
    dtc/powerpc: remove obsolete .gitignore entries
    powerpc/85xx: fix race bug of calling request_irq after enable elbc interrupts
    powerpc/book3e: Fix CPU feature handling on e5500 in 32-bit mode
    powerpc/fsl_rio: Fix compile error when CONFIG_FSL_RIO not set

    Linus Torvalds
     
  • * 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32:
    unicore32: using generic-y format for one line asm-generic files
    unicore32: change PERCPU to PERCPU_SECTION
    unicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig)
    unicore32: change zImage physical address, though it's PIC codes
    unicore32: move rtc-puv3.c to drivers/rtc directory

    Linus Torvalds
     
  • Unconditionally changing the address limit to USER_DS and not restoring
    it to its old value in the error path is wrong because it prevents us
    using kernel memory on repeated calls to this function. This, in fact,
    breaks the fallback of hard coded paths to the init program from being
    ever successful if the first candidate fails to load.

    With this patch applied switching to USER_DS is delayed until the point
    of no return is reached which makes it possible to have a multi-arch
    rootfs with one arch specific init binary for each of the (hard coded)
    probed paths.

    Since the address limit is already set to USER_DS when start_thread()
    will be invoked, this redundancy can be safely removed.

    Signed-off-by: Mathias Krause
    Cc: Al Viro
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Mathias Krause
     

09 Jun, 2011

11 commits


08 Jun, 2011

11 commits

  • …file into perf/urgent

    Ingo Molnar
     
  • After a newly plugged CPU sets the cpu_online bit it enables
    interrupts and goes idle. The cpu which brought up the new cpu waits
    for the cpu_online bit and when it observes it, it sets the cpu_active
    bit for this cpu. The cpu_active bit is the relevant one for the
    scheduler to consider the cpu as a viable target.

    With forced threaded interrupt handlers which imply forced threaded
    softirqs we observed the following race:

    cpu 0 cpu 1

    bringup(cpu1);
    set_cpu_online(smp_processor_id(), true);
    local_irq_enable();
    while (!cpu_online(cpu1));
    timer_interrupt()
    -> wake_up(softirq_thread_cpu1);
    -> enqueue_on(softirq_thread_cpu1, cpu0);

    ^^^^

    cpu_notify(CPU_ONLINE, cpu1);
    -> sched_cpu_active(cpu1)
    -> set_cpu_active((cpu1, true);

    When an interrupt happens before the cpu_active bit is set by the cpu
    which brought up the newly onlined cpu, then the scheduler refuses to
    enqueue the woken thread which is bound to that newly onlined cpu on
    that newly onlined cpu due to the not yet set cpu_active bit and
    selects a fallback runqueue. Not really an expected and desirable
    behaviour.

    So far this has only been observed with forced hard/softirq threading,
    but in theory this could happen without forced threaded hard/softirqs
    as well. It's probably unobservable as it would take a massive
    interrupt storm on the newly onlined cpu which causes the softirq loop
    to wake up the softirq thread and an even longer delay of the cpu
    which waits for the cpu_online bit.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Peter Zijlstra
    Cc: stable@kernel.org # 2.6.39

    Thomas Gleixner
     
  • …/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:
    x86/amd-iommu: Fix boot crash with hidden PCI devices
    x86/amd-iommu: Use only per-device dma_ops
    x86/amd-iommu: Fix 3 possible endless loops

    Linus Torvalds
     
  • * 'kvm-updates/3.0' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: Initialize kvm before registering the mmu notifier
    KVM: x86: use proper port value when checking io instruction permission
    KVM: add missing void __user * cast to access_ok() call

    Linus Torvalds
     
  • _sdata needs to be declared in the linker script now as of commit
    a2d063ac216c ("extable, core_kernel_data(): Make sure all archs define
    _sdata")

    Signed-off-by: David Howells
    Cc: Steven Rostedt
    Signed-off-by: Linus Torvalds

    David Howells
     
  • die_if_no_fixup() shouldn't use get_user() as it doesn't call set_fs() to
    indicate that it wants to probe a kernel address. Instead it should use
    probe_kernel_read().

    This fixes the problem of gdb seeing SIGILL rather than SIGTRAP when hitting
    the KGDB special breakpoint upon SysRq+g being seen. The problem was that
    die_if_no_fixup() was failing to read the opcode of the instruction that caused
    the exception, and thus not fixing up the exception.

    This caused gdb to get a S04 response to the $? request in its remote protocol
    rather than S05 - which would then cause it to continue with $C04 rather than
    $c in an attempt to pass the signal onto the inferior process. The kernel,
    however, does not support $Cnn, and so objects by returning an E22 response,
    indicating an error. gdb does not expect this and prints:

    warning: Remote failure reply: E22

    and then returns to the gdb command prompt unable to continue.

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

    David Howells
     
  • One of the kernel debugger cacheflush variants escaped proper testing. Two of
    the labels are wrong, being derived from the code that was copied to construct
    the variant.

    The first label results in the following assembler message:

    AS arch/mn10300/mm/cache-dbg-flush-by-reg.o
    arch/mn10300/mm/cache-dbg-flush-by-reg.S: Assembler messages:
    arch/mn10300/mm/cache-dbg-flush-by-reg.S:123: Error: symbol `debugger_local_cache_flushinv_no_dcache' is already defined

    And the second label results in the following linker message:

    arch/mn10300/mm/built-in.o:(.text+0x1d39): undefined reference to `mn10300_local_icache_inv_range_reg_end'
    arch/mn10300/mm/built-in.o:(.text+0x1d39): relocation truncated to fit: R_MN10300_PCREL16 against undefined symbol `mn10300_local_icache_inv_range_reg_end'

    To test this file the following configuration pieces must be set:

    CONFIG_AM34=y
    CONFIG_MN10300_CACHE_WBACK=y
    CONFIG_MN10300_DEBUGGER_CACHE_FLUSH_BY_REG=y
    CONFIG_MN10300_CACHE_MANAGE_BY_REG=y
    CONFIG_AM34_HAS_CACHE_SNOOP=n

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

    David Howells
     
  • * 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
    [S390] fix kvm defines for 31 bit compile
    [S390] use generic RCU page-table freeing code
    [S390] qdio: Split SBAL entry flags
    [S390] kvm-s390: fix stfle facilities numbers >=64
    [S390] kvm-s390: Fix host crash on misbehaving guests

    Linus Torvalds
     
  • * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (21 commits)
    ARM: OMAP4: MMC: increase delay for pbias
    arm: omap2plus: move NAND_BLOCK_SIZE out of boards
    omap4: hwmod: Enable the keypad
    omap3: Free Beagle rev gpios when they are read, so others can read them later
    arm: omap3: beagle: Ensure msecure is mux'd to be able to set the RTC
    omap: rx51: Don't power up speaker amplifier at bootup
    omap: rx51: Set regulator V28_A always on
    ARM: OMAP4: MMC: no regulator off during probe for eMMC
    arm: omap2plus: fix ads7846 pendown gpio request
    ARM: OMAP2: Add missing iounmap in omap4430_phy_init
    ARM: omap4: Pass core and wakeup mux tables to omap4_mux_init
    ARM: omap2+: mux: Allow board mux settings to be NULL
    OMAP4: fix return value of omap4_l3_init
    OMAP: iovmm: fix SW flags passed by user
    arch/arm/mach-omap1/dma.c: Invert calls to platform_device_put and platform_device_del
    OMAP2+: mux: fix compilation warnings
    OMAP: SRAM: Fix warning: format '%08lx' expects type 'long unsigned int'
    arm: omap3: cm-t3517: fix section mismatch warning
    OMAP2+: Fix 9 section mismatch(es) warnings from mach-omap2/built-in.o
    ARM: OMAP2: Add missing include of linux/gpio.h
    ...

    Linus Torvalds
     
  • Semicolons are not necessary after switch/while/for/if braces
    so remove them.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Some devices that can generate interrupts are connected directly to the
    CPU through the bootbus on sun4d. This patch allows IRQs to be allocated
    for such devices. The information used for allocating interrupts for
    sbus devices are present at the corresponding SBI node. For bootbus
    devices this information is present in the bootbus node.

    Signed-off-by: Kjetil Oftedal
    Signed-off-by: David S. Miller

    oftedal