Date: Wed, 7 May 2003 12:30:57 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 30716 for review Message-ID: <200305071930.h47JUvKw055292@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=30716 Change 30716 by peter@peter_daintree on 2003/05/07 12:30:10 Fix the context switch bug with a sledgehammer. Defer re-enabling interrupts till after we've retrieved the user stack pointer from PCPU area, otherwise if we preempt and another process makes a syscall before we resume saving, then all hell breaks loose. This defers the sti for too long and that needs to be fixed, but that can be fixed later. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/exception.S#2 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/exception.S#2 (text+ko) ==== @@ -202,7 +202,6 @@ #swapgs movq %rsp,PCPU(SCRATCH_RSP) movq common_tss+COMMON_TSS_RSP0,%rsp - sti /* Now emulate a trapframe. Ugh. */ subq $TF_SIZE,%rsp movq $KUDSEL,TF_SS(%rsp) @@ -226,6 +225,7 @@ movq %r15,TF_R15(%rsp) /* C preserved */ movq PCPU(SCRATCH_RSP),%r12 /* %r12 already saved */ movq %r12,TF_RSP(%rsp) /* user stack pointer */ + sti call syscall movq PCPU(CURPCB),%rax testq $PCB_FULLCTX,PCB_FLAGS(%rax)help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305071930.h47JUvKw055292>
