07 Nov, 2011

1 commit

  • * '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
     

01 Nov, 2011

1 commit


29 Sep, 2011

1 commit

  • 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
     

01 Jul, 2011

2 commits

  • The perf_event overflow handler does not receive any caller-derived
    argument, so many callers need to resort to looking up the perf_event
    in their local data structure. This is ugly and doesn't scale if a
    single callback services many perf_events.

    Fix by adding a context parameter to perf_event_create_kernel_counter()
    (and derived hardware breakpoints APIs) and storing it in the perf_event.
    The field can be accessed from the callback as event->overflow_handler_context.
    All callers are updated.

    Signed-off-by: Avi Kivity
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1309362157-6596-2-git-send-email-avi@redhat.com
    Signed-off-by: Ingo Molnar

    Avi Kivity
     
  • The nmi parameter indicated if we could do wakeups from the current
    context, if not, we would set some state and self-IPI and let the
    resulting interrupt do the wakeup.

    For the various event classes:

    - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from
    the PMI-tail (ARM etc.)
    - tracepoint: nmi=0; since tracepoint could be from NMI context.
    - software: nmi=[0,1]; some, like the schedule thing cannot
    perform wakeups, and hence need 0.

    As one can see, there is very little nmi=1 usage, and the down-side of
    not using it is that on some platforms some software events can have a
    jiffy delay in wakeup (when arch_irq_work_raise isn't implemented).

    The up-side however is that we can remove the nmi parameter and save a
    bunch of conditionals in fast paths.

    Signed-off-by: Peter Zijlstra
    Cc: Michael Cree
    Cc: Will Deacon
    Cc: Deng-Cheng Zhu
    Cc: Anton Blanchard
    Cc: Eric B Munson
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: David S. Miller
    Cc: Frederic Weisbecker
    Cc: Jason Wessel
    Cc: Don Zickus
    Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

26 May, 2011

1 commit

  • This patch implements the raw syscall tracepoints on PowerPC and exports
    them for ftrace syscalls to use.

    To minimise reworking existing code, I slightly re-ordered the thread
    info flags such that the new TIF_SYSCALL_TRACEPOINT bit would still fit
    within the 16 bits of the andi. instruction's UI field. The instructions
    in question are in /arch/powerpc/kernel/entry_{32,64}.S to and the
    _TIF_SYSCALL_T_OR_A with the thread flags to see if system call tracing
    is enabled.

    In the case of 64bit PowerPC, arch_syscall_addr and
    arch_syscall_match_sym_name are overridden to allow ftrace syscalls to
    work given the unusual system call table structure and symbol names that
    start with a period.

    Signed-off-by: Ian Munsie
    Signed-off-by: Benjamin Herrenschmidt

    Ian Munsie
     

06 May, 2011

1 commit

  • We make use of ptrace_get_breakpoints() / ptrace_put_breakpoints() to
    protect ptrace_set_debugreg() even if CONFIG_HAVE_HW_BREAKPOINT if off.
    However in this case, these APIs are not implemented.

    To fix this, push the protection down inside the relevant ifdef.
    Best would be to export the code inside
    CONFIG_HAVE_HW_BREAKPOINT into a standalone function to cleanup
    the ifdefury there and call the breakpoint ref API inside. But
    as it is more invasive, this should be rather made in an -rc1.

    Fixes this build error:

    arch/powerpc/kernel/ptrace.c:1594: error: implicit declaration of function 'ptrace_get_breakpoints' make[2]: ***

    Reported-by: Ingo Molnar
    Signed-off-by: Frederic Weisbecker
    Cc: LPPC
    Cc: Prasad
    Cc: v2.6.33..
    Link: http://lkml.kernel.org/r/1304639598-4707-1-git-send-email-fweisbec@gmail.com
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

25 Apr, 2011

1 commit

  • While the tracer accesses ptrace breakpoints, the child task may
    concurrently exit due to a SIGKILL and thus release its breakpoints
    at the same time. We can then dereference some freed pointers.

    To fix this, hold a reference on the child breakpoints before
    manipulating them.

    Reported-by: Oleg Nesterov
    Signed-off-by: Frederic Weisbecker
    Acked-by: Prasad
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Cc: Paul Mundt
    Cc: v2.6.33..
    Link: http://lkml.kernel.org/r/1302284067-7860-4-git-send-email-fweisbec@gmail.com

    Frederic Weisbecker
     

31 Mar, 2011

1 commit


21 Mar, 2011

1 commit

  • In some cases during a threaded core dump not all the threads will have
    a full register set. This happens when the signal causing the core dump
    races with a thread exiting. The race happens when the exiting thread
    has entered the kernel for the last time before the signal arrives, but
    doesn't get far enough through the exit code to avoid being included
    in the core dump.

    So we get a thread included in the core dump which is never going to go
    out to userspace again and only has a partial register set recorded

    Normally we would catch each thread as it is about to go into userspace
    and capture the full register set then.

    However, this exiting thread is never going to go out to userspace
    again, so we have no way to capture its full register set. It doesn't
    really matter, though, as this is a thread which is effectively
    already dead.

    So instead of hitting a BUG() in this case (a really bad choice of
    action in the first place), we use a poison value for the register
    values.

    [BenH]: Some cosmetic/stylistic changes and fix build on ppc32

    Signed-off-by: Mike Wolf
    Signed-off-by: Benjamin Herrenschmidt

    Mike Wolf
     

09 Dec, 2010

1 commit


28 Oct, 2010

2 commits

  • Use new 'datavp' and 'datalp' variables in order to remove unnecessary
    castings.

    Signed-off-by: Namhyung Kim
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • Fix up the arguments to arch_ptrace() to take account of the fact that
    @addr and @data are now unsigned long rather than long as of a preceding
    patch in this series.

    Signed-off-by: Namhyung Kim
    Cc:
    Acked-by: Roland McGrath
    Acked-by: David Howells
    Acked-by: Geert Uytterhoeven
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     

02 Sep, 2010

1 commit


22 Jun, 2010

1 commit

  • Implement perf-events based hw-breakpoint interfaces for PowerPC
    64-bit server (Book III S) processors. This allows access to a
    given location to be used as an event that can be counted or
    profiled by the perf_events subsystem.

    This is done using the DABR (data breakpoint register), which can
    also be used for process debugging via ptrace. When perf_event
    hw_breakpoint support is configured in, the perf_event subsystem
    manages the DABR and arbitrates access to it, and ptrace then
    creates a perf_event when it is requested to set a data breakpoint.

    [Adopted suggestions from Paul Mackerras to
    - emulate_step() all system-wide breakpoints and single-step only the
    per-task breakpoints
    - perform arch-specific cleanup before unregistration through
    arch_unregister_hw_breakpoint()
    ]

    Signed-off-by: K.Prasad
    Signed-off-by: Paul Mackerras

    K.Prasad
     

07 Apr, 2010

1 commit


09 Mar, 2010

2 commits

  • Another fix for the extended ptrace patches in the -next tree.

    The handling of breakpoints and watchpoints is inconsistent. When a
    breakpoint or watchpoint is hit, the interrupt handler is clearing the
    proper bits in the dbcr* registers, but leaving the dac* and iac* registers
    alone. The ptrace code to delete the break/watchpoints checks the dac* and
    iac* registers for zero to determine if they are enabled. Instead, they
    should check the dbcr* bits.

    Signed-off-by: Dave Kleikamp
    Signed-off-by: Benjamin Herrenschmidt

    Dave Kleikamp
     
  • powerpc/booke: Fix a couple typos in the advanced ptrace code

    Found and fixed a couple typos in the advanced ptrace patches.
    (These patches are currently in benh's next tree.)

    Signed-off-by: Dave Kleikamp
    Cc: Benjamin Herrenschmidt
    Cc: linuxppc-dev list
    Signed-off-by: Benjamin Herrenschmidt

    Dave Kleikamp
     

17 Feb, 2010

3 commits

  • powerpc/booke: Add support for advanced debug registers

    From: Dave Kleikamp

    Based on patches originally written by Torez Smith.

    This patch defines context switch and trap related functionality
    for BookE specific Debug Registers. It adds support to ptrace()
    for setting and getting BookE related Debug Registers

    Signed-off-by: Dave Kleikamp
    Cc: Torez Smith
    Cc: Benjamin Herrenschmidt
    Cc: David Gibson
    Cc: Josh Boyer
    Cc: Kumar Gala
    Cc: Sergio Durigan Junior
    Cc: Thiago Jung Bauermann
    Cc: linuxppc-dev list
    Signed-off-by: Benjamin Herrenschmidt

    Dave Kleikamp
     
  • powerpc: Extended ptrace interface

    From: Dave Kleikamp

    Based on patches originally written by Torez Smith.

    Add a new extended ptrace interface so that user-space has a single
    interface for powerpc, without having to know the specific layout
    of the debug registers.

    Implement:
    PPC_PTRACE_GETHWDEBUGINFO
    PPC_PTRACE_SETHWDEBUG
    PPC_PTRACE_DELHWDEBUG

    Signed-off-by: Dave Kleikamp
    Acked-by: David Gibson
    Cc: Torez Smith
    Cc: Benjamin Herrenschmidt
    Cc: Josh Boyer
    Cc: Kumar Gala
    Cc: Sergio Durigan Junior
    Cc: Thiago Jung Bauermann
    Cc: linuxppc-dev list
    Signed-off-by: Benjamin Herrenschmidt

    Dave Kleikamp
     
  • powerpc/booke: Introduce new CONFIG options for advanced debug registers

    From: Dave Kleikamp

    Introduce new config options to simplify the ifdefs pertaining to the
    advanced debug registers for booke and 40x processors:

    CONFIG_PPC_ADV_DEBUG_REGS - boolean: true for dac-based processors
    CONFIG_PPC_ADV_DEBUG_IACS - number of IAC registers
    CONFIG_PPC_ADV_DEBUG_DACS - number of DAC registers
    CONFIG_PPC_ADV_DEBUG_DVCS - number of DVC registers
    CONFIG_PPC_ADV_DEBUG_DAC_RANGE - DAC ranges supported

    Beginning conservatively, since I only have the facilities to test 440
    hardware. I believe all 40x and booke platforms support at least 2 IAC
    and 2 DAC registers. For 440, 4 IAC and 2 DVC registers are enabled, as
    well as the DAC ranges.

    Signed-off-by: Dave Kleikamp
    Acked-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    Dave Kleikamp
     

15 Jul, 2009

1 commit

  • On booke processors, gdb is seeing spurious SIGTRAPs when setting a
    watchpoint.

    user_disable_single_step() simply quits when the DAC is non-zero. It should
    be clearing the DBCR0_IC and DBCR0_BT bits from the dbcr0 register and
    TIF_SINGLESTEP from the thread flag.

    Signed-off-by: Dave Kleikamp
    Signed-off-by: Benjamin Herrenschmidt

    Dave Kleikamp
     

09 Jun, 2009

1 commit

  • Reworked by: Benjamin Herrenschmidt

    This adds block-step support on powerpc, including a PTRACE_SINGLEBLOCK
    request for ptrace.

    The BookE implementation is tweaked to fire a single step after a
    block step in order to mimmic the server behaviour.

    Signed-off-by: Roland McGrath
    Signed-off-by: Benjamin Herrenschmidt

    Roland McGrath
     

30 Jul, 2008

2 commits


28 Jul, 2008

2 commits


25 Jul, 2008

1 commit

  • This patch implements support for HW based watchpoint via the
    DBSR_DAC (Data Address Compare) facility of the BookE processors.

    It does so by interfacing with the existing DABR breakpoint code
    and adding the necessary bits and pieces for the new bits to
    be properly set or cleared

    Signed-off-by: Luis Machado
    Signed-off-by: Benjamin Herrenschmidt

    Luis Machado
     

01 Jul, 2008

4 commits

  • This correctly hooks the VSX dump into Roland McGrath core file
    infrastructure. It adds the VSX dump information as an additional elf
    note in the core file (after talking more to the tool chain/gdb guys).
    This also ensures the formats are consistent between signals, ptrace
    and core files.

    Signed-off-by: Michael Neuling
    Signed-off-by: Paul Mackerras

    Michael Neuling
     
  • This patch extends the floating point save and restore code to use the
    VSX load/stores when VSX is available. This will make FP context
    save/restore marginally slower on FP only code, when VSX is available,
    as it has to load/store 128bits rather than just 64bits.

    Mixing FP, VMX and VSX code will get constant architected state.

    The signals interface is extended to enable access to VSR 0-31
    doubleword 1 after discussions with tool chain maintainers. Backward
    compatibility is maintained.

    The ptrace interface is also extended to allow access to VSR 0-31 full
    registers.

    Signed-off-by: Michael Neuling
    Signed-off-by: Paul Mackerras

    Michael Neuling
     
  • The layout of the new VSR registers and how they overlap on top of the
    legacy FPR and VR registers is:

    VSR doubleword 0 VSR doubleword 1
    ----------------------------------------------------------------
    VSR[0] | FPR[0] | |
    ----------------------------------------------------------------
    VSR[1] | FPR[1] | |
    ----------------------------------------------------------------
    | ... | |
    | ... | |
    ----------------------------------------------------------------
    VSR[30] | FPR[30] | |
    ----------------------------------------------------------------
    VSR[31] | FPR[31] | |
    ----------------------------------------------------------------
    VSR[32] | VR[0] |
    ----------------------------------------------------------------
    VSR[33] | VR[1] |
    ----------------------------------------------------------------
    | ... |
    | ... |
    ----------------------------------------------------------------
    VSR[62] | VR[30] |
    ----------------------------------------------------------------
    VSR[63] | VR[31] |
    ----------------------------------------------------------------

    VSX has 64 128bit registers. The first 32 regs overlap with the FP
    registers and hence extend them with and additional 64 bits. The
    second 32 regs overlap with the VMX registers.

    This commit introduces the thread_struct changes required to reflect
    this register layout. Ptrace and signals code is updated so that the
    floating point registers are correctly accessed from the thread_struct
    when CONFIG_VSX is enabled.

    Signed-off-by: Michael Neuling
    Signed-off-by: Paul Mackerras

    Michael Neuling
     
  • We are going to change where the floating point registers are stored
    in the thread_struct, so in preparation add some macros to access the
    floating point registers. Update all code to use these new macros.

    Signed-off-by: Michael Neuling
    Signed-off-by: Paul Mackerras

    Michael Neuling
     

20 Mar, 2008

1 commit

  • The PTRACE_SETREGS request was only recently added on powerpc,
    and gdb does not use it. So it slipped through without getting
    all the testing it should have had.

    The user_regset changes had a simple bug in storing to all of
    the 32-bit general registers block on 64-bit kernels. This bug
    only comes up with PTRACE_SETREGS, not PPC_PTRACE_SETREGS.
    It causes a BUG_ON to hit, so this fix needs to go in ASAP.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     

07 Feb, 2008

7 commits

  • This makes the SPE register data appear in ELF core dumps, using the
    new n_type value NT_PPC_SPE (0x101). This new note type is not used
    by any consumers of core files yet, but support can be added. I don't
    even have any hardware with SPE capabilities, so I've never seen such
    a note. But this demonstrates how simple it is to export register
    information in core dumps when the user_regset style is used for the
    low-level code.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     
  • Now that ptrace_request handles these, we can drop some more boilerplate.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     
  • This replaces all the code for powerpc PTRACE_*REGS* requests with
    simple calls to copy_regset_from_user and copy_regset_to_user. All
    the ptrace formats are either the whole corresponding user_regset
    format (core dump format) or a leading subset of it, so we can get
    rid of all the remaining embedded knowledge of both those layouts
    and of the internal data structures they correspond to. Only the
    user_regset accessors need to implement that.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     
  • This extends task_user_regset_view CONFIG_PPC64 with support for the
    32-bit view of register state, compatible with what a CONFIG_PPC32
    kernel provides. This will enable generic machine-independent code to
    access user-mode threads' registers for debugging and dumping.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     
  • This provides the task_user_regset_view entry point and support for
    all the native-mode (64 on CONFIG_PPC64, 32 on CONFIG_PPC32) thread
    register state. This will enable generic machine-independent code to
    access user-mode threads' registers for debugging and dumping.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     
  • This implements user_regset-style accessors for the powerpc general
    registers. In the future these functions will be the only place that
    needs to understand the user_regset layout (core dump format) and how
    it maps to the internal representation of user thread state.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath
     
  • This isolates the ptrace code for the special-case registers msr and trap
    from the ptrace-layout dispatch code. This should inline away completely.
    It cleanly separates the low-level machine magic that has to be done for
    deep reasons, from the superficial details of the ptrace interface.

    Signed-off-by: Roland McGrath
    Signed-off-by: Paul Mackerras

    Roland McGrath