]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: different probe trigger instruction for entry vs return
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 16 May 2017 13:59:32 +0000 (09:59 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 23 May 2017 14:22:21 +0000 (10:22 -0400)
commit60d9ab808030ebcdc653dda0e460321b709627db
treec3b02adad43a0582c9248ed410ac4f763213e271
parentfd09db08e45c1c6ae2489c65176d88086dcb1a4d
dtrace: different probe trigger instruction for entry vs return

On x86_64, we cannot use the LOCK prefix byte to consistently cause an
invalid opcode trap for FBT return probes because the 'ret' instruction
may be followed by an instruction that can validly take the LOCK prefix.
So, we use a different trigger instruction (int3).

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").

Orabug: 25949048
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
dtrace/fbt_x86_64.c
dtrace/sdt_x86_64.c