]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: make x86_64 FBT return probe detection less restrictive
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 16 May 2017 03:29:16 +0000 (23:29 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 23 May 2017 13:44:39 +0000 (09:44 -0400)
commitaa4f3190484515fb7ca1b7822b6b77a2f0489b88
treede35c490e88b0e83872f0c3cdc58ad75931bdcc4
parentf51c6a99a599f0294c3e86dcd3ff104cff5570da
dtrace: make x86_64 FBT return probe detection less restrictive

The FBT return probe detection mechanism on x86_64 was requiring that
the "ret" instruction be followed by a "push %rbp" or "nop", which is
much too restrictive.  The new code allows probing of all "ret"
instructions that occur in a function regardless of what instructions
follows.

In order to make this possible, the functions to set and clear FBT
probes on x86_64 (dtrace_invop_add() and dtrace_invop_remove()) have
been modified to accept a 2nd argument that indicates the instruction
to patch the probe location with.  This is needed because FBT return
probes need a different instruction on x86_64 (LOCK prefix to force
an invalid opcode trap isn't safe because we do not know what
instruction may follow the "ret").

This commit also fixes the declaration of the dtrace_bad_address()
function that was missing its return type.

Orabug: 25949048
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
arch/x86/include/asm/dtrace_util.h
arch/x86/kernel/dtrace_fbt.c
arch/x86/kernel/dtrace_util.c