aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-08-19 21:00:02 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-08-19 21:00:02 +0000
commitcef5e2bd91b4fe56b6704846da5502be31945a15 (patch)
treea73ac6d52f34580fdc57f9bc3bf2e1d38ce92131
parent7692d200c10a971f5a812d08423355c3946ce534 (diff)
Notes
-rw-r--r--sys/i386/i386/exception.s13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index caf7bf2bc921..b905fb1fd635 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -183,12 +183,16 @@ calltrap:
#ifdef KDTRACE_HOOKS
SUPERALIGN_TEXT
IDTVEC(ill)
- /* Check if there is no DTrace hook registered. */
- cmpl $0,dtrace_invop_jump_addr
+ /*
+ * Check if a DTrace hook is registered. The default (data) segment
+ * cannot be used for this since %ds is not known good until we
+ * verify that the entry was from kernel mode.
+ */
+ cmpl $0,%ss:dtrace_invop_jump_addr
je norm_ill
/*
- * Check if this is a user fault. If so, just handle it as a normal
+ * Check if this is a user fault. If so, just handle it as a normal
* trap.
*/
cmpl $GSEL_KPL, 4(%esp) /* Check the code segment */
@@ -200,7 +204,8 @@ IDTVEC(ill)
* This is a kernel instruction fault that might have been caused
* by a DTrace provider.
*/
- pushal /* Push all registers onto the stack. */
+ pushal
+ cld
/*
* Set our jump address for the jump back in the event that