svn commit: r251313 - in stable/8/sys: amd64/amd64 i386/i386

Konstantin Belousov kib at FreeBSD.org
Mon Jun 3 17:13:38 UTC 2013


Author: kib
Date: Mon Jun  3 17:13:37 2013
New Revision: 251313
URL: http://svnweb.freebsd.org/changeset/base/251313

Log:
  MFC r251033:
  When handling an exception from the attempt from loading the faulting
  context on return from the trap handler, re-enable the interrupts on
  i386 and amd64.

Modified:
  stable/8/sys/amd64/amd64/exception.S
  stable/8/sys/i386/i386/exception.s
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/   (props changed)
  stable/8/sys/i386/   (props changed)

Modified: stable/8/sys/amd64/amd64/exception.S
==============================================================================
--- stable/8/sys/amd64/amd64/exception.S	Mon Jun  3 17:07:57 2013	(r251312)
+++ stable/8/sys/amd64/amd64/exception.S	Mon Jun  3 17:13:37 2013	(r251313)
@@ -818,6 +818,10 @@ doreti_iret_fault:
 	.globl	ds_load_fault
 ds_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
+	testl	$PSL_I,TF_RFLAGS(%rsp)
+	jz	1f
+	sti
+1:
 	movq	%rsp,%rdi
 	call	trap
 	movw	$KUDSEL,TF_DS(%rsp)
@@ -827,6 +831,10 @@ ds_load_fault:
 	.globl	es_load_fault
 es_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
+	testl	$PSL_I,TF_RFLAGS(%rsp)
+	jz	1f
+	sti
+1:
 	movq	%rsp,%rdi
 	call	trap
 	movw	$KUDSEL,TF_ES(%rsp)
@@ -835,6 +843,10 @@ es_load_fault:
 	ALIGN_TEXT
 	.globl	fs_load_fault
 fs_load_fault:
+	testl	$PSL_I,TF_RFLAGS(%rsp)
+	jz	1f
+	sti
+1:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
 	movq	%rsp,%rdi
 	call	trap
@@ -846,6 +858,10 @@ fs_load_fault:
 gs_load_fault:
 	popfq
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
+	testl	$PSL_I,TF_RFLAGS(%rsp)
+	jz	1f
+	sti
+1:
 	movq	%rsp,%rdi
 	call	trap
 	movw	$KUG32SEL,TF_GS(%rsp)
@@ -855,6 +871,10 @@ gs_load_fault:
 	.globl	fsbase_load_fault
 fsbase_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
+	testl	$PSL_I,TF_RFLAGS(%rsp)
+	jz	1f
+	sti
+1:
 	movq	%rsp,%rdi
 	call	trap
 	movq	PCPU(CURTHREAD),%r8
@@ -866,6 +886,10 @@ fsbase_load_fault:
 	.globl	gsbase_load_fault
 gsbase_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
+	testl	$PSL_I,TF_RFLAGS(%rsp)
+	jz	1f
+	sti
+1:
 	movq	%rsp,%rdi
 	call	trap
 	movq	PCPU(CURTHREAD),%r8

Modified: stable/8/sys/i386/i386/exception.s
==============================================================================
--- stable/8/sys/i386/i386/exception.s	Mon Jun  3 17:07:57 2013	(r251312)
+++ stable/8/sys/i386/i386/exception.s	Mon Jun  3 17:13:37 2013	(r251313)
@@ -417,6 +417,7 @@ doreti_popl_es_fault:
 	pushl	%fs
 	.globl	doreti_popl_fs_fault
 doreti_popl_fs_fault:
+	sti
 	movl	$0,TF_ERR(%esp)	/* XXX should be the error code */
 	movl	$T_PROTFLT,TF_TRAPNO(%esp)
 	jmp	alltraps_with_regs_pushed


More information about the svn-src-all mailing list