]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: add support for passing return value from trap handlers
authorKris Van Hees <kris.van.hees@oracle.com>
Thu, 22 Dec 2016 07:20:57 +0000 (02:20 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Sat, 24 Dec 2016 02:51:47 +0000 (21:51 -0500)
commit559ab88733463614f050818c4e3a519d5bf665d4
tree9f3b2079371f5dc4064648db94609a9e35084f9f
parent8caffd5c0dc315de48e4ced5e896f3d29a8bbaa4
dtrace: add support for passing return value from trap handlers

Prior to this patch, trap handlers were called to service traps without
any mechanism to report back to the lowest level trap entry point.  The
DTrace FBT implementation on x86 needs to be able to do just that because
FBT probes are enabled by replacing a one-byte assembler instruction with
a one-byte instruction that causes a trap.  After the trap is handled, we
need to emulate the instruction that was replaced prior to returning to
the original instruction stream.  Because different instructions may occur
at FBT probe points, we need to be able to report back to the trap entry
point which instruction was replaced by the trap.

Handlers that do not use notify_die() always return 0.  Those who do use
notify_die() to call handlers have been modified to return the value that
the handler passed on its return.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-By: Dan Duval <dan.duval@oracle.com>
Orabug: 25312278
arch/x86/include/asm/mce.h
arch/x86/include/asm/traps.h
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/kvm.c
arch/x86/kernel/nmi.c
arch/x86/kernel/traps.c
arch/x86/mm/fault.c