about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-11-28 08:32:24 +0000
committerUlrich Drepper <drepper@redhat.com>2002-11-28 08:32:24 +0000
commitacd42b789378ab70046966872003347c0ef067db (patch)
treeb8c0b7bdc9c5c312581e8550b02e98aa077b58d8
parentd08bef807b655576c07e5dffe8365d0713b218c4 (diff)
downloadglibc-acd42b789378ab70046966872003347c0ef067db.tar.gz
glibc-acd42b789378ab70046966872003347c0ef067db.tar.xz
glibc-acd42b789378ab70046966872003347c0ef067db.zip
Update.
2002-11-28  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/x86_64/vfork.S: Don't trash the CPU's
	branch prediction buffers by using unpaired call/ret.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/vfork.S13
2 files changed, 10 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 74344ba2f1..6f33fb4ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-28  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/x86_64/vfork.S: Don't trash the CPU's
+	branch prediction buffers by using unpaired call/ret.
+
 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/i386/sysdep.h (ASMFMT_2): Fix typo in
diff --git a/sysdeps/unix/sysv/linux/x86_64/vfork.S b/sysdeps/unix/sysv/linux/x86_64/vfork.S
index 79f3260efc..3315df7253 100644
--- a/sysdeps/unix/sysv/linux/x86_64/vfork.S
+++ b/sysdeps/unix/sysv/linux/x86_64/vfork.S
@@ -29,22 +29,19 @@ ENTRY (__vfork)
 
 	/* Pop the return PC value into RDI.  We need a register that
 	   is preserved by the syscall and that we're allowed to destroy. */
-	popq %rdi
+	popq	%rdi
 
 	/* Stuff the syscall number in RAX and enter into the kernel.  */
 	movl	$SYS_ify (vfork), %eax
 	syscall
-	cmpl	$-4095, %eax
-	jae	.Lerror		/* Branch forward if it failed.  */
-
-	/* Jump to the return PC.  */
-	jmp	*%rdi
 
-.Lerror:
 	/* Push back the return PC.  */
 	pushq	%rdi
-	jmp	SYSCALL_ERROR_LABEL
 
+	cmpl	$-4095, %eax
+	jae SYSCALL_ERROR_LABEL		/* Branch forward if it failed.  */
+
+	/* Normal return.  */
 .Lpseudo_end:
 	ret