From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 15 15:25:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73976106566B; Wed, 15 Dec 2010 15:25:57 +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 46B3B8FC13; Wed, 15 Dec 2010 15:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFFPvaY056366; Wed, 15 Dec 2010 15:25:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFFPv2q056362; Wed, 15 Dec 2010 15:25:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012151525.oBFFPv2q056362@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 15 Dec 2010 15:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216458 - in stable/8/sys/amd64: amd64 linux32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 15:25:57 -0000 Author: kib Date: Wed Dec 15 15:25:56 2010 New Revision: 216458 URL: http://svn.freebsd.org/changeset/base/216458 Log: MFC r216255: Update some comments related to use of amd64 full context switch. In exec_linux_setregs(), use locally cached pointer to pcb to set pcb_full_iret. In set_regs(), note that full return is needed when code that sets segment registers is enabled. Approved by: re (bz) Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/amd64/linux32/linux32_sysvec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Wed Dec 15 15:23:25 2010 (r216457) +++ stable/8/sys/amd64/amd64/machdep.c Wed Dec 15 15:25:56 2010 (r216458) @@ -1895,6 +1895,7 @@ set_regs(struct thread *td, struct reg * tp->tf_fs = regs->r_fs; tp->tf_gs = regs->r_gs; tp->tf_flags = TF_HASSEGS; + td->td_pcb->pcb_full_iret = 1; } return (0); } Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Wed Dec 15 15:23:25 2010 (r216457) +++ stable/8/sys/amd64/amd64/vm_machdep.c Wed Dec 15 15:25:56 2010 (r216458) @@ -339,10 +339,9 @@ cpu_set_syscall_retval(struct thread *td * Reconstruct pc, we know that 'syscall' is 2 bytes, * lcall $X,y is 7 bytes, int 0x80 is 2 bytes. * We saved this in tf_err. - * We have to do a full context restore so that %r10 - * (which was holding the value of %rcx) is restored + * %r10 (which was holding the value of %rcx) is restored * for the next iteration. - * r10 restore is only required for freebsd/amd64 processes, + * %r10 restore is only required for freebsd/amd64 processes, * but shall be innocent for any ia32 ABI. */ td->td_frame->tf_rip -= td->td_frame->tf_err; Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysvec.c Wed Dec 15 15:23:25 2010 (r216457) +++ stable/8/sys/amd64/linux32/linux32_sysvec.c Wed Dec 15 15:25:56 2010 (r216458) @@ -875,13 +875,13 @@ exec_linux_setregs(td, entry, stack, ps_ regs->tf_flags = TF_HASSEGS; regs->tf_cs = _ucode32sel; regs->tf_rbx = ps_strings; - td->td_pcb->pcb_full_iret = 1; load_cr0(rcr0() | CR0_MP | CR0_TS); fpstate_drop(td); - /* Return via doreti so that we can change to a different %cs */ + /* Do full restore on return so that we can change to a different %cs */ pcb->pcb_flags |= PCB_32BIT; pcb->pcb_flags &= ~PCB_GS32BIT; + pcb->pcb_full_iret = 1; td->td_retval[1] = 0; }