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 Xsyscall: save %es before enabling inte...



details:   https://anonhg.NetBSD.org/src/rev/db52b7bec202
branches:  trunk
changeset: 758144:db52b7bec202
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu Oct 21 11:39:45 2010 +0000

description:
Xsyscall: save %es before enabling interrupts.  otherwise it can be
clobbered by preemption.  PR/43903.

diffstat:

 sys/arch/amd64/amd64/locore.S |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 210bedbaf7bf -r db52b7bec202 sys/arch/amd64/amd64/locore.S
--- a/sys/arch/amd64/amd64/locore.S     Thu Oct 21 11:28:34 2010 +0000
+++ b/sys/arch/amd64/amd64/locore.S     Thu Oct 21 11:39:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.58 2010/07/07 01:14:52 chs Exp $  */
+/*     $NetBSD: locore.S,v 1.59 2010/10/21 11:39:45 yamt Exp $ */
 
 /*
  * Copyright-o-rama!
@@ -1085,12 +1085,12 @@
        pushq   $(LSEL(LUDATA_SEL, SEL_UPL))    /* Known to be user ss */
        pushq   %r15                            /* User space rsp */
        movq    CPUVAR(SCRATCH),%r15
+       subq    $TF_REGSIZE+(TF_RSP-TF_TRAPNO),%rsp
+       movw    %es,TF_ES(%rsp)
        sti
-       subq    $TF_REGSIZE+(TF_RSP-TF_TRAPNO),%rsp
        INTR_SAVE_GPRS
        movw    %fs,TF_FS(%rsp)
        movw    %gs,TF_GS(%rsp)
-       movw    %es,TF_ES(%rsp)
        movw    $(LSEL(LUDATA_SEL, SEL_UPL)),TF_DS(%rsp)
        movq    %r11, TF_RFLAGS(%rsp)   /* old rflags from syscall insn */
        movq    $(LSEL(LUCODE_SEL, SEL_UPL)), TF_CS(%rsp)



Home | Main Index | Thread Index | Old Index