From owner-svn-src-stable@FreeBSD.ORG Fri Aug 31 12:06:33 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F4981065698; Fri, 31 Aug 2012 12:06:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 501478FC18; Fri, 31 Aug 2012 12:06:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VC6X90027488; Fri, 31 Aug 2012 12:06:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VC6XlS027486; Fri, 31 Aug 2012 12:06:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311206.q7VC6XlS027486@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 12:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239948 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 12:06:33 -0000 Author: kib Date: Fri Aug 31 12:06:32 2012 New Revision: 239948 URL: http://svn.freebsd.org/changeset/base/239948 Log: MFC r238670: Stop caching curpcb in the local variable. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:04:29 2012 (r239947) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:06:32 2012 (r239948) @@ -582,7 +582,6 @@ static int err_count = 0; void fpudna(void) { - struct pcb *pcb; critical_enter(); if (PCPU_GET(fpcurthread) == curthread) { @@ -604,11 +603,10 @@ fpudna(void) * Record new context early in case frstor causes a trap. */ PCPU_SET(fpcurthread, curthread); - pcb = curpcb; fpu_clean_state(); - if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly @@ -619,17 +617,17 @@ fpudna(void) * fpu_initialstate, to ignite the XSAVEOPT * tracking engine. */ - bcopy(fpu_initialstate, pcb->pcb_save, cpu_max_ext_state_size); - fpurestore(pcb->pcb_save); - if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) - fldcw(pcb->pcb_initial_fpucw); - if (PCB_USER_FPU(pcb)) - set_pcb_flags(pcb, + bcopy(fpu_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); + fpurestore(curpcb->pcb_save); + if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) + fldcw(curpcb->pcb_initial_fpucw); + if (PCB_USER_FPU(curpcb)) + set_pcb_flags(curpcb, PCB_FPUINITDONE | PCB_USERFPUINITDONE); else - set_pcb_flags(pcb, PCB_FPUINITDONE); + set_pcb_flags(curpcb, PCB_FPUINITDONE); } else - fpurestore(pcb->pcb_save); + fpurestore(curpcb->pcb_save); critical_exit(); } @@ -963,16 +961,14 @@ fpu_kern_leave(struct thread *td, struct int fpu_kern_thread(u_int flags) { - struct pcb *pcb; - pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); - KASSERT(pcb->pcb_save == get_pcb_user_save_pcb(pcb), + KASSERT(curpcb->pcb_save == get_pcb_user_save_pcb(curpcb), ("mangled pcb_save")); - KASSERT(PCB_USER_FPU(pcb), ("recursive call")); + KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - set_pcb_flags(pcb, PCB_KERNFPU); + set_pcb_flags(curpcb, PCB_KERNFPU); return (0); }