powerpc: Add DSCR support to ptrace
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 10 Jan 2013 20:29:09 +0000 (20:29 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 15 Jan 2013 18:25:46 +0000 (05:25 +1100)
commit1715a826a5b72d4fb882504d0babcea9aec8a0db
treef7f4fc57450c6e5842002f9c459a11a0d7b7ebda
parent61383407677aef05928541a00678591abea2d84c
powerpc: Add DSCR support to ptrace

The DSCR (aka Data Stream Control Register) is supported on some
server PowerPC chips and allow some control over the prefetch
of data streams.

The kernel already supports DSCR value per thread but there is also
a need in a ability to change it from an external process for
the specific pid.

The patch adds new register index PT_DSCR (index=44) which can be
set/get by:
  ptrace(PTRACE_POKEUSER, traced_process, PT_DSCR << 3, dscr);
  dscr = ptrace(PTRACE_PEEKUSER, traced_process, PT_DSCR << 3, NULL);

The patch does not increase PT_REGS_COUNT as the pt_regs struct has not
been changed.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/uapi/asm/ptrace.h
arch/powerpc/kernel/ptrace.c