17 Nov, 2011

4 commits

  • On PPC64, put_sigset_t converts a sigset_t to a compat_sigset_t
    before copying it to userspace. There is a typo in the case that
    we have 4 words to copy, meaning that we corrupt the compat_sigset_t.

    It appears that _NSIG_WORDS can't be greater than 2 at the moment
    so this code is probably always optimised away anyway.

    Signed-off-by: Will Deacon
    Signed-off-by: Benjamin Herrenschmidt

    Will Deacon
     
  • With the introduction of CONFIG_PPC_ADV_DEBUG_REGS user space debug is
    broken on Book-E 64-bit parts that support delayed debug events. When
    switch_booke_debug_regs() sets DBCR0 we'll start getting debug events as
    MSR_DE is also set and we aren't able to handle debug events from kernel
    space.

    We can remove the hack that always enables MSR_DE and loads up DBCR0 and
    just utilize switch_booke_debug_regs() to get user space debug working
    again.

    We still need to handle critical/debug exception stacks & proper
    save/restore of state for those exception levles to support debug events
    from kernel space like we have on 32-bit.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • All of DebugException is already protected by CONFIG_PPC_ADV_DEBUG_REGS
    there is no need to have another such ifdef inside the function.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • We had an existing ifdef for 4xx & BOOKE processors that got changed to
    CONFIG_PPC_ADV_DEBUG_REGS. The define has nothing to do with
    CONFIG_PPC_ADV_DEBUG_REGS. The define really should be:

    #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)

    and not

    #ifdef CONFIG_PPC_ADV_DEBUG_REGS

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     

16 Nov, 2011

5 commits

  • The trace_hardirqs_off will use CALLER_ADDR0 and CALLER_ADDR1.
    If an exception occurs in user mode, there is only one stack frame
    on the stack and accessing the CALLER_ADDR1 will causes the following
    call trace. So we create a dummy stack frame to make
    trace_hardirqs_off happy.

    WARNING: at kernel/smp.c:459
    Modules linked in:
    NIP: c0093280 LR: c00930a0 CTR: c0010780
    REGS: edb87ae0 TRAP: 0700 Not tainted (3.1.0)
    MSR: 00021002 CR: 28002888 XER: 00000000
    TASK = edce2ac0[17658] 'mthread-lock-on' THREAD: edb86000 CPU: 5
    GPR00: 00000001 edb87b90 edce2ac0 00000005 c0019594 edb87bd8 00000001 00000fe3
    GPR08: 00041000 c084138c 4e20120d edb87b90 48002888 1001aa7c 00000000 00000000
    GPR16: 48830000 10012a8c 00000000 10000af4 00000001 c0810000 00000000 00000000
    GPR24: ee9aa920 c0816a18 00000000 00000005 c0019594 edb87bd8 ee20178c edb87b90
    NIP [c0093280] smp_call_function_many+0x214/0x2b4
    LR [c00930a0] smp_call_function_many+0x34/0x2b4
    Call Trace:
    [edb87b90] [c00930a0] smp_call_function_many+0x34/0x2b4 (unreliable)
    [edb87bd0] [c00194ec] __flush_tlb_page+0xac/0x100
    [edb87c00] [c001957c] flush_tlb_page+0x3c/0x54
    [edb87c10] [c00180ac] ptep_set_access_flags+0x74/0x12c
    [edb87c40] [c0128068] handle_pte_fault+0x2f0/0x9ac
    [edb87cb0] [c0128c3c] handle_mm_fault+0x104/0x1dc
    [edb87ce0] [c05f40f4] do_page_fault+0x2dc/0x630
    [edb87e50] [c001078c] handle_page_fault+0xc/0x80

    Signed-off-by: Benjamin Herrenschmidt

    Kevin Hao
     
  • kdump fails because we try to execute an HV only instruction. Feature
    fixups are being applied after we copy the exception vectors down to 0
    so they miss out on any updates.

    We have always had this issue but it only became critical in v3.0
    when we added CFAR support (breaks POWER5) and v3.1 when we added
    POWERNV (breaks everyone).

    Signed-off-by: Anton Blanchard
    Cc: [v3.0+]
    Signed-off-by: Benjamin Herrenschmidt

    Anton Blanchard
     
  • I had to debug a strange situation where all manner of things were
    failing. SMT threads, storage and network were all completely broken.

    The root cause was we couldn't find enough memory to instantiate RTAS -
    this was a network install so the initrd was huge.

    Instead of limping along and failing in mysterious ways we should just
    panic up front if RTAS exists and we can't allocate space for it.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Benjamin Herrenschmidt

    Anton Blanchard
     
  • Kexec is not supported on 47x. 47x is a variant of 44x with slightly
    different MMU and SMP support. There was a typo in the config dependency
    for kexec. This patch fixes the same.

    Signed-off-by: Suzuki K. Poulose
    Signed-off-by: Paul Bolle
    Cc: Kumar Gala
    Cc: Josh Boyer
    Cc: linux ppc dev
    Signed-off-by: Benjamin Herrenschmidt

    Suzuki Poulose
     
  • Should do what other architectures do and wrap all that code into
    the appropriate ifdef

    Signed-off-by: Al Viro
    Signed-off-by: Benjamin Herrenschmidt

    Al Viro
     

08 Nov, 2011

2 commits

  • When running with HV KVM and CBE config options enabled, I get
    build failures like the following:

    arch/powerpc/kernel/head_64.o: In function `cbe_system_error_hv':
    (.text+0x1228): undefined reference to `do_kvm_0x1202'
    arch/powerpc/kernel/head_64.o: In function `cbe_maintenance_hv':
    (.text+0x1628): undefined reference to `do_kvm_0x1602'
    arch/powerpc/kernel/head_64.o: In function `cbe_thermal_hv':
    (.text+0x1828): undefined reference to `do_kvm_0x1802'

    This is because we jump to a KVM handler when HV is enabled, but we
    only generate the handler with PR KVM mode.

    Signed-off-by: Alexander Graf
    Signed-off-by: Benjamin Herrenschmidt

    Alexander Graf
     
  • Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
    We run all interrupt handlers with interrupts disabled
    and we even check and yell when an interrupt handler
    returns with interrupts enabled (see commit [b738a50a:
    genirq: Warn when handler enables interrupts]).

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Acked-by: Arnd Bergmann
    Acked-by: Geoff Levand
    Signed-off-by: Benjamin Herrenschmidt

    Yong Zhang
     

07 Nov, 2011

2 commits

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     
  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (106 commits)
    powerpc/p3060qds: Add support for P3060QDS board
    powerpc/83xx: Add shutdown request support to MCU handling on MPC8349 MITX
    powerpc/85xx: Make kexec to interate over online cpus
    powerpc/fsl_booke: Fix comment in head_fsl_booke.S
    powerpc/85xx: issue 15 EOI after core reset for FSL CoreNet devices
    powerpc/8xxx: Fix interrupt handling in MPC8xxx GPIO driver
    powerpc/85xx: Add 'fsl,pq3-gpio' compatiable for GPIO driver
    powerpc/86xx: Correct Gianfar support for GE boards
    powerpc/cpm: Clear muram before it is in use.
    drivers/virt: add ioctl for 32-bit compat on 64-bit to fsl-hv-manager
    powerpc/fsl_msi: add support for "msi-address-64" property
    powerpc/85xx: Setup secondary cores PIR with hard SMP id
    powerpc/fsl-booke: Fix settlbcam for 64-bit
    powerpc/85xx: Adding DCSR node to dtsi device trees
    powerpc/85xx: clean up FPGA device tree nodes for Freecsale QorIQ boards
    powerpc/85xx: fix PHYS_64BIT selection for P1022DS
    powerpc/fsl-booke: Fix setup_initial_memory_limit to not blindly map
    powerpc: respect mem= setting for early memory limit setup
    powerpc: Update corenet64_smp_defconfig
    powerpc: Update mpc85xx/corenet 32-bit defconfigs
    ...

    Fix up trivial conflicts in:
    - arch/powerpc/configs/40x/hcu4_defconfig
    removed stale file, edited elsewhere
    - arch/powerpc/include/asm/udbg.h, arch/powerpc/kernel/udbg.c:
    added opal and gelic drivers vs added ePAPR driver
    - drivers/tty/serial/8250.c
    moved UPIO_TSI to powerpc vs removed UPIO_DWAPB support

    Linus Torvalds
     

04 Nov, 2011

1 commit


01 Nov, 2011

8 commits

  • None of the files touched here are modules, and they are not
    exporting any symbols either -- so there is no need to be including
    the module.h. Builds of all the files remains successful.

    Even kernel/module.c does not need to include it, since it includes
    linux/moduleloader.h instead.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • All these files were including module.h just for the basic
    EXPORT_SYMBOL infrastructure. We can shift them off to the
    export.h header which is a way smaller footprint and thus
    realize some compile time gains.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • This file only needs export.h to get EXPORT_SYMBOL, but in doing
    so, it uncovers an implicit use of linux/cache.h as follows:

    CC arch/powerpc/kernel/firmware.o
    arch/powerpc/kernel/firmware.c:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__read_mostly'
    arch/powerpc/kernel/firmware.c:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__used'
    make[2]: *** [arch/powerpc/kernel/firmware.o] Error 1

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • They are getting it through device.h --> module.h path, but we want
    to clean that up. This is a sample of what will happen if we don't:

    pseries/iommu.c: In function 'tce_build_pSeriesLP':
    pseries/iommu.c:136: error: implicit declaration of function 'show_stack'

    pseries/eeh.c: In function 'eeh_token_to_phys':
    pseries/eeh.c:359: error: 'init_mm' undeclared (first use in this function)

    pseries/eeh_event.c: In function 'eeh_event_handler':
    pseries/eeh_event.c:63: error: implicit declaration of function 'daemonize'
    pseries/eeh_event.c:64: error: implicit declaration of function 'set_current_state'
    pseries/eeh_event.c:64: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
    pseries/eeh_event.c:64: error: (Each undeclared identifier is reported only once
    pseries/eeh_event.c:64: error: for each function it appears in.)
    pseries/eeh_event.c: In function 'eeh_thread_launcher':
    pseries/eeh_event.c:109: error: 'CLONE_KERNEL' undeclared (first use in this function)

    hotplug-cpu.c: In function 'pseries_mach_cpu_die':
    hotplug-cpu.c:115: error: implicit declaration of function 'idle_task_exit'

    kernel/swsusp_64.c: In function 'do_after_copyback':
    kernel/swsusp_64.c:17: error: implicit declaration of function 'touch_softlockup_watchdog'

    cell/spufs/context.c: In function 'alloc_spu_context':
    cell/spufs/context.c:60: error: implicit declaration of function 'get_task_mm'
    cell/spufs/context.c:60: warning: assignment makes pointer from integer without a cast
    cell/spufs/context.c: In function 'spu_forget':
    cell/spufs/context.c:127: error: implicit declaration of function 'mmput'

    pasemi/dma_lib.c: In function 'pasemi_dma_stop_chan':
    pasemi/dma_lib.c:332: error: implicit declaration of function 'cond_resched'

    sysdev/fsl_lbc.c: In function 'fsl_lbc_ctrl_irq':
    sysdev/fsl_lbc.c:247: error: 'TASK_NORMAL' undeclared (first use in this function)

    Add in sched.h so these get the definitions they are looking for.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • They get it via module.h (via device.h) but we want to clean that up.
    When we do, we'll get things like:

    ibmebus.c:314: error: 'S_IWUSR' undeclared here (not in a function)
    vio.c:972: error: 'S_IWUSR' undeclared here (not in a function)

    so add in the stat header it is using explicitly in advance.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • Fix failures in powerpc associated with the previously allowed
    implicit module.h presence that now lead to things like this:

    arch/powerpc/mm/mmu_context_hash32.c:76:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
    arch/powerpc/mm/tlb_hash32.c:48:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
    arch/powerpc/kernel/pci_32.c:51:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
    arch/powerpc/kernel/iomap.c:36:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
    arch/powerpc/platforms/44x/canyonlands.c:126:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
    arch/powerpc/kvm/44x.c:168:59: error: 'THIS_MODULE' undeclared (first use in this function)

    [with several contibutions from Stephen Rothwell ]

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • With module.h being implicitly everywhere via device.h, the absence
    of explicitly including something for EXPORT_SYMBOL went unnoticed.
    Since we are heading to fix things up and clean module.h from the
    device.h file, we need to explicitly include these files now.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • It was coming in via device.h --> module.h etc. but we want to
    clean that up. So explicitly include the header where init_mm
    is being declared.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

31 Oct, 2011

1 commit

  • * 'kvm-updates/3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (75 commits)
    KVM: SVM: Keep intercepting task switching with NPT enabled
    KVM: s390: implement sigp external call
    KVM: s390: fix register setting
    KVM: s390: fix return value of kvm_arch_init_vm
    KVM: s390: check cpu_id prior to using it
    KVM: emulate lapic tsc deadline timer for guest
    x86: TSC deadline definitions
    KVM: Fix simultaneous NMIs
    KVM: x86 emulator: convert push %sreg/pop %sreg to direct decode
    KVM: x86 emulator: switch lds/les/lss/lfs/lgs to direct decode
    KVM: x86 emulator: streamline decode of segment registers
    KVM: x86 emulator: simplify OpMem64 decode
    KVM: x86 emulator: switch src decode to decode_operand()
    KVM: x86 emulator: qualify OpReg inhibit_byte_regs hack
    KVM: x86 emulator: switch OpImmUByte decode to decode_imm()
    KVM: x86 emulator: free up some flag bits near src, dst
    KVM: x86 emulator: switch src2 to generic decode_operand()
    KVM: x86 emulator: expand decode flags to 64 bits
    KVM: x86 emulator: split dst decode to a generic decode_operand()
    KVM: x86 emulator: move memop, memopp into emulation context
    ...

    Linus Torvalds
     

12 Oct, 2011

2 commits


07 Oct, 2011

1 commit


29 Sep, 2011

3 commits

  • The firmware on old 970 blades supports some kind of takeover called
    "TNK takeover" which will crash if we try to probe for OPAL takeover,
    so don't do it.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • The current L1 cache read event code 0x80082 only counts for thread 0. The
    event code 0x280030 should be used to count events on thread 0 and 1. The
    patch fixes the event code for the L1 cache read.

    The current L1 cache write event code 0x80086 only counts for thread 0. The
    event code 0x180032 should be used to count events on thread 0 and 1. The
    patch fixes the event code for the L1 cache write.

    FYI, the documentation lists three event codes for the L1 cache read event
    and three event codes for the L1 cache write event. The event description
    for the event codes is as follows:

    L1 cache read requests 0x80082 LSU 0 only
    L1 cache read requests 0x8008A LSU 1 only
    L1 cache read requests 0x80030 LSU 1 or LSU 0, counter 2 only.

    L1 cache store requests 0x80086 LSU 0 only
    L1 cache store requests 0x8008E LSU 1 only
    L1 cache store requests 0x80032 LSU 0 or LSU 1, counter 1 only.

    There can only be one request from either LSU 0 or 1 active at a time.

    Signed-off-by: Carl Love
    Acked-by: Paul Mackerras
    Signed-off-by: Benjamin Herrenschmidt

    Carl E. Love
     
  • gcc (rightfully) complains that we are accessing beyond the
    end of the fpr array (we do, to access the fpscr).

    The only sane thing to do (whether anything in that code can be
    called remotely sane is debatable) is to special case fpscr and
    handle it as a separate statement.

    I initially tried to do it it by making the array access conditional
    to index < PT_FPSCR and using a 3rd else leg but for some reason gcc
    was unable to understand it and still spewed the warning.

    So I ended up with something a tad more intricated but it seems to
    build on 32-bit and on 64-bit with and without VSX.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

26 Sep, 2011

4 commits

  • We don't want to configure PCI Express Max Payload Size or
    Max Read Request Size on systems that set that flag. The
    firmware will have done it for us, and under hypervisors such
    as pHyp we don't even see the parent switches and bridges and
    thus can make no assumption on what values are safe to use.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • With a KVM guest operating in SMT4 mode (i.e. 4 hardware threads per
    core), whenever a CPU goes idle, we have to pull all the other
    hardware threads in the core out of the guest, because the H_CEDE
    hcall is handled in the kernel. This is inefficient.

    This adds code to book3s_hv_rmhandlers.S to handle the H_CEDE hcall
    in real mode. When a guest vcpu does an H_CEDE hcall, we now only
    exit to the kernel if all the other vcpus in the same core are also
    idle. Otherwise we mark this vcpu as napping, save state that could
    be lost in nap mode (mainly GPRs and FPRs), and execute the nap
    instruction. When the thread wakes up, because of a decrementer or
    external interrupt, we come back in at kvm_start_guest (from the
    system reset interrupt vector), find the `napping' flag set in the
    paca, and go to the resume path.

    This has some other ramifications. First, when starting a core, we
    now start all the threads, both those that are immediately runnable and
    those that are idle. This is so that we don't have to pull all the
    threads out of the guest when an idle thread gets a decrementer interrupt
    and wants to start running. In fact the idle threads will all start
    with the H_CEDE hcall returning; being idle they will just do another
    H_CEDE immediately and go to nap mode.

    This required some changes to kvmppc_run_core() and kvmppc_run_vcpu().
    These functions have been restructured to make them simpler and clearer.
    We introduce a level of indirection in the wait queue that gets woken
    when external and decrementer interrupts get generated for a vcpu, so
    that we can have the 4 vcpus in a vcore using the same wait queue.
    We need this because the 4 vcpus are being handled by one thread.

    Secondly, when we need to exit from the guest to the kernel, we now
    have to generate an IPI for any napping threads, because an HDEC
    interrupt doesn't wake up a napping thread.

    Thirdly, we now need to be able to handle virtual external interrupts
    and decrementer interrupts becoming pending while a thread is napping,
    and deliver those interrupts to the guest when the thread wakes.
    This is done in kvmppc_cede_reentry, just before fast_guest_return.

    Finally, since we are not using the generic kvm_vcpu_block for book3s_hv,
    and hence not calling kvm_arch_vcpu_runnable, we can remove the #ifdef
    from kvm_arch_vcpu_runnable.

    Signed-off-by: Paul Mackerras
    Signed-off-by: Alexander Graf

    Paul Mackerras
     
  • This simplifies the way that the book3s_pr makes the transition to
    real mode when entering the guest. We now call kvmppc_entry_trampoline
    (renamed from kvmppc_rmcall) in the base kernel using a normal function
    call instead of doing an indirect call through a pointer in the vcpu.
    If kvm is a module, the module loader takes care of generating a
    trampoline as it does for other calls to functions outside the module.

    kvmppc_entry_trampoline then disables interrupts and jumps to
    kvmppc_handler_trampoline_enter in real mode using an rfi[d].
    That then uses the link register as the address to return to
    (potentially in module space) when the guest exits.

    This also simplifies the way that we call the Linux interrupt handler
    when we exit the guest due to an external, decrementer or performance
    monitor interrupt. Instead of turning on the MMU, then deciding that
    we need to call the Linux handler and turning the MMU back off again,
    we now go straight to the handler at the point where we would turn the
    MMU on. The handler will then return to the virtual-mode code
    (potentially in the module).

    Along the way, this moves the setting and clearing of the HID5 DCBZ32
    bit into real-mode interrupts-off code, and also makes sure that
    we clear the MSR[RI] bit before loading values into SRR0/1.

    The net result is that we no longer need any code addresses to be
    stored in vcpu->arch.

    Signed-off-by: Paul Mackerras
    Signed-off-by: Alexander Graf

    Paul Mackerras
     
  • This makes arch/powerpc/kvm/book3s_rmhandlers.S and
    arch/powerpc/kvm/book3s_hv_rmhandlers.S be assembled as
    separate compilation units rather than having them #included in
    arch/powerpc/kernel/exceptions-64s.S. We no longer have any
    conditional branches between the exception prologs in
    exceptions-64s.S and the KVM handlers, so there is no need to
    keep their contents close together in the vmlinux image.

    In their current location, they are using up part of the limited
    space between the first-level interrupt handlers and the firmware
    NMI data area at offset 0x7000, and with some kernel configurations
    this area will overflow (e.g. allyesconfig), leading to an
    "attempt to .org backwards" error when compiling exceptions-64s.S.

    Moving them out requires that we add some #includes that the
    book3s_{,hv_}rmhandlers.S code was previously getting implicitly
    via exceptions-64s.S.

    Signed-off-by: Paul Mackerras
    Signed-off-by: Alexander Graf

    Paul Mackerras
     

23 Sep, 2011

1 commit

  • Some devices have a dma-window that starts at the address 0. This allows
    DMA addresses to be mapped to this address and returned to drivers as a
    valid DMA address. Some drivers may not behave well in this case, since
    the address 0 is considered an error or not allocated.

    The solution to avoid this kind of error from happening is reserve the
    page addressed as 0 so it cannot be allocated for a DMA mapping.

    Signed-off-by: Thadeu Lima de Souza Cascardo
    Signed-off-by: Benjamin Herrenschmidt

    Thadeu Lima de Souza Cascardo
     

20 Sep, 2011

6 commits

  • perf events, powerpc: Add POWER7 stalled-cycles-frontend/backend events

    Extent the POWER7 PMU driver with definitions for generic front-end and back-end
    stall events.

    As explained in Ingo's original comment(8f62242246351b5a4bc0c1f00c0c7003edea128a
    ), the exact definitions of the stall events are very much processor specific as

    different things mean different in their respective instruction pipeline. These
    two Power7 raw events are the closest approximation to the concept detailed in
    Ingo's comment.

    [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x100f8, /* GCT_NOSLOT_CYC */
    It means cycles when the Global Completion Table has no slots from this thread

    [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x4000a, /* CMPLU_STALL */
    It means no groups completed and GCT not empty for this thread

    Signed-off-by: Anshuman Khandual
    Signed-off-by: Benjamin Herrenschmidt

    Anshuman Khandual
     
  • OPAL can handle various interrupt for us such as Machine Checks (it
    performs all sorts of recovery tasks and passes back control to us with
    informations about the error), Hardware Management Interrupts and Softpatch
    interrupts.

    This wires up the mechanisms and prints out specific informations returned
    by HAL when a machine check occurs.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This adds a udbg and an hvc console backend for supporting a console
    using the OPAL console interfaces.

    On OPAL v1 we have hvc0 mapped to whatever console the system was
    configured for (network or hvsi serial port) via the service
    processor.

    On OPAL v2 we have hvcN mapped to the Nth console provided by OPAL
    which generally corresponds to:

    hvc0 : network console (raw protocol)
    hvc1 : serial port S1 (hvsi)
    hvc2 : serial port S2 (hvsi)

    Note: At this point, early debug console only works with OPAL v1
    and shouldn't be enabled in a normal kernel.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • OPAL v2 is instantiated in a way similar to RTAS using Open Firmware
    client interface calls, and the resulting address and entry point are
    put in the device-tree

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • Add definition of OPAL interfaces along with the wrappers to call
    into OPAL runtime and the early device-tree parsing hook to locate
    the OPAL runtime firmware.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • We stash it in boot_command_line which isn't in BSS and so won't
    be overwritten. We then use that as a default cmd_line before
    we walk the device-tree.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt