From ec45d1cfd3cb65121fc52f39efc17d832f4f7b91 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 17 Jan 2013 12:31:45 +0000 Subject: arm64: mm: update CONTEXTIDR register to contain PID of current process This patch is a port of 575320d62 ("ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process") from ARM that introduces a new Kconfig option which, when enabled, causes the kernel to write the PID of the current task into the CONTEXTIDR register 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. Signed-off-by: Will Deacon [catalin.marinas@arm.com: contextidr_thread_switch() moved to mmu_context.h] Signed-off-by: Catalin Marinas --- arch/arm64/Kconfig.debug | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'arch/arm64/Kconfig.debug') diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug index 79871cd78da8..51493430f142 100644 --- a/arch/arm64/Kconfig.debug +++ b/arch/arm64/Kconfig.debug @@ -33,4 +33,12 @@ config EARLY_PRINTK is assumed that the early console device has been initialised by the boot loader prior to starting the Linux kernel. +config PID_IN_CONTEXTIDR + bool "Write the current PID to the CONTEXTIDR register" + help + Enabling this option causes the kernel to write the current PID to + the CONTEXTIDR register, at the expense of some additional + instructions during context switch. Say Y here only if you are + planning to use hardware trace tools with this kernel. + endmenu -- cgit v1.2.3-59-g8ed1b