ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process
authorWill Deacon <will.deacon@arm.com>
Fri, 6 Jul 2012 14:43:03 +0000 (15:43 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 9 Jul 2012 16:41:10 +0000 (17:41 +0100)
commit575320d625d5b5eb115575a1f5e17af456e69577
treedc44829a23c7eb3d6da82533853a3c9d304df6d7
parent27a5569dc66ecce06cb532542ddcd0b6da8783f6
ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process

This patch introduces a new Kconfig option which, when enabled, causes
the kernel to write the PID of the current task into the PROCID field
of the CONTEXTIDR on context switch. This is useful when analysing
hardware trace, since writes to this register can be configured to emit
an event into the trace stream.

The thread notifier for writing the PID is deliberately kept separate
from the ASID-writing code so that we can support newer processors using
LPAE, where the ASID is stored in TTBR0. As such, the switch_mm code is
updated to perform a read-modify-write sequence to ensure that we don't
clobber the PID on CPUs using the classic 2-level page tables.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig.debug
arch/arm/mm/context.c
arch/arm/mm/proc-v6.S
arch/arm/mm/proc-v7-2level.S