Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 Construct the trap frame with interrupt...



details:   https://anonhg.NetBSD.org/src/rev/f43a230942b0
branches:  trunk
changeset: 826386:f43a230942b0
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Aug 31 09:27:28 2017 +0000

description:
Construct the trap frame with interrupts disabled, for safety, just like
the rest of the interrupt entry points.

diffstat:

 sys/arch/amd64/amd64/locore.S |  17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diffs (41 lines):

diff -r 7007ad5e240f -r f43a230942b0 sys/arch/amd64/amd64/locore.S
--- a/sys/arch/amd64/amd64/locore.S     Thu Aug 31 08:47:19 2017 +0000
+++ b/sys/arch/amd64/amd64/locore.S     Thu Aug 31 09:27:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.126 2017/08/10 12:49:11 maxv Exp $        */
+/*     $NetBSD: locore.S,v 1.127 2017/08/31 09:27:28 maxv Exp $        */
 
 /*
  * Copyright-o-rama!
@@ -1264,28 +1264,19 @@
 
        movq    $2,TF_ERR(%rsp)         /* syscall instruction size */
        movq    $T_ASTFLT,TF_TRAPNO(%rsp)
-
-       movw    %es,TF_ES(%rsp)
-       sti
-       INTR_SAVE_GPRS
-       movw    %fs,TF_FS(%rsp)
-       movw    %gs,TF_GS(%rsp)
-       movw    $(LSEL(LUDATA_SEL, SEL_UPL)),TF_DS(%rsp)
 #else
        /* Xen already switched to kernel stack */
-       pushq   %rsi
-       STI(si)
-       popq    %rsi
        addq    $0x10,%rsp      /* gap to match cs:rip */
        pushq   $2              /* error code */
        pushq   $T_ASTFLT
        subq    $TF_REGSIZE,%rsp
+#endif
        INTR_SAVE_GPRS
+       movw    %es,TF_ES(%rsp)
        movw    %fs,TF_FS(%rsp)
        movw    %gs,TF_GS(%rsp)
-       movw    %es,TF_ES(%rsp)
        movw    $(LSEL(LUDATA_SEL, SEL_UPL)),TF_DS(%rsp)
-#endif
+       STI(si)
 
 do_syscall:
        movq    CPUVAR(CURLWP),%r14



Home | Main Index | Thread Index | Old Index