From owner-p4-projects@FreeBSD.ORG Fri Apr 25 18:06:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D158C37B404; Fri, 25 Apr 2003 18:06:43 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6603237B401 for ; Fri, 25 Apr 2003 18:06:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F1FF43FCB for ; Fri, 25 Apr 2003 18:06:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3Q16g0U002416 for ; Fri, 25 Apr 2003 18:06:42 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3Q16g1k002410 for perforce@freebsd.org; Fri, 25 Apr 2003 18:06:42 -0700 (PDT) Date: Fri, 25 Apr 2003 18:06:42 -0700 (PDT) Message-Id: <200304260106.h3Q16g1k002410@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 29753 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2003 01:06:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=29753 Change 29753 by peter@peter_daintree on 2003/04/25 18:06:27 Optimize a little. The cli is redundant, the only code path there is via the AST check which leaves interrupts disabled. Branch for the unusual case (full context restore), not the usual case. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#30 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#30 (text+ko) ==== @@ -229,9 +229,7 @@ call syscall movq PCPU(CURPCB),%rax testq $PCB_FULLCTX,PCB_FLAGS(%rax) - je 1f - andq $~PCB_FULLCTX,PCB_FLAGS(%rax) - jmp doreti + jne 3f /* simplified from doreti */ 1: /* Check for and handle AST's on return to userland */ cli @@ -243,7 +241,6 @@ call ast jmp 1b 2: /* restore preserved registers */ - movq TF_RSP(%rsp),%rdi /* user stack pointer */ movq TF_RAX(%rsp),%rax /* return value 1 */ movq TF_RDX(%rsp),%rdx /* return value 2 */ movq TF_RBX(%rsp),%rbx /* C preserved */ @@ -254,10 +251,13 @@ movq TF_R15(%rsp),%r15 /* C preserved */ movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ - cli + movq TF_RSP(%rsp),%rdi /* user stack pointer */ movq %rdi,%rsp /* original %rsp */ #swapgs sysretq +3: /* Requested full context restore, use doreti for that */ + andq $~PCB_FULLCTX,PCB_FLAGS(%rax) + jmp doreti ENTRY(fork_trampoline) movq %r12, %rdi /* function */