[Midnightbsd-cvs] src [9469] trunk/sys: When handling an exception from the attempt from loading the faulting
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Mar 5 14:45:14 EST 2017
Revision: 9469
http://svnweb.midnightbsd.org/src/?rev=9469
Author: laffer1
Date: 2017-03-05 14:45:14 -0500 (Sun, 05 Mar 2017)
Log Message:
-----------
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 Paths:
--------------
trunk/sys/amd64/amd64/exception.S
trunk/sys/i386/i386/exception.s
Modified: trunk/sys/amd64/amd64/exception.S
===================================================================
--- trunk/sys/amd64/amd64/exception.S 2017-03-05 19:44:41 UTC (rev 9468)
+++ trunk/sys/amd64/amd64/exception.S 2017-03-05 19:45:14 UTC (rev 9469)
@@ -823,6 +823,10 @@
.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)
@@ -832,6 +836,10 @@
.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)
@@ -840,6 +848,10 @@
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
@@ -851,6 +863,10 @@
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)
@@ -860,6 +876,10 @@
.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
@@ -871,6 +891,10 @@
.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: trunk/sys/i386/i386/exception.s
===================================================================
--- trunk/sys/i386/i386/exception.s 2017-03-05 19:44:41 UTC (rev 9468)
+++ trunk/sys/i386/i386/exception.s 2017-03-05 19:45:14 UTC (rev 9469)
@@ -422,6 +422,7 @@
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 Midnightbsd-cvs
mailing list