Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2013 06:56:58 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r255905 - stable/9/sys/amd64/amd64
Message-ID:  <201309270656.r8R6uwDb089723@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Sep 27 06:56:58 2013
New Revision: 255905
URL: http://svnweb.freebsd.org/changeset/base/255905

Log:
  MFC r255844:
  Ensure that the ERESTART return from the syscall reloads the registers,
  to make the restarted syscall instruction pass the correct arguments.
  
  PR:	kern/182161

Modified:
  stable/9/sys/amd64/amd64/vm_machdep.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- stable/9/sys/amd64/amd64/vm_machdep.c	Thu Sep 26 22:47:02 2013	(r255904)
+++ stable/9/sys/amd64/amd64/vm_machdep.c	Fri Sep 27 06:56:58 2013	(r255905)
@@ -400,9 +400,13 @@ cpu_set_syscall_retval(struct thread *td
 		 * for the next iteration.
 		 * %r10 restore is only required for freebsd/amd64 processes,
 		 * but shall be innocent for any ia32 ABI.
+		 *
+		 * Require full context restore to get the arguments
+		 * in the registers reloaded at return to usermode.
 		 */
 		td->td_frame->tf_rip -= td->td_frame->tf_err;
 		td->td_frame->tf_r10 = td->td_frame->tf_rcx;
+		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 		break;
 
 	case EJUSTRETURN:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309270656.r8R6uwDb089723>