arm64: ptrace: Add function argument access API
authorMasami Hiramatsu <mhiramat@kernel.org>
Fri, 12 Apr 2019 14:22:01 +0000 (23:22 +0900)
committerWill Deacon <will.deacon@arm.com>
Fri, 12 Apr 2019 16:04:27 +0000 (17:04 +0100)
commita823c35ff2eda73046cc1847326071de350fceda
treec1e5fa47ee4c105168ad1fbc08529f85e785a110
parent691efbedc60d2a7364a90e38882fc762f06f52c4
arm64: ptrace: Add function argument access API

Add regs_get_argument() which returns N th argument of the function
call. On arm64, it supports up to 8th argument.
Note that this chooses most probably assignment, in some case
it can be incorrect (e.g. passing data structure or floating
point etc.)

This enables ftrace kprobe events to access kernel function
arguments via $argN syntax.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
[will: tidied up the comment a bit]
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/ptrace.h