This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-293-gea8ba7c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  ea8ba7cd14d0f479bae8365ae5c4ef177bdd0aad (commit)
      from  3c799e913168a84197c08e62d47be666329308e0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ea8ba7cd14d0f479bae8365ae5c4ef177bdd0aad

commit ea8ba7cd14d0f479bae8365ae5c4ef177bdd0aad
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Wed Apr 16 14:43:16 2014 -0700

    Save/restore bound registers for _dl_runtime_profile
    
    This patch saves and restores bound registers in x86-64 PLT for
    ld.so profile and LD_AUDIT:
    
    	* sysdeps/x86_64/bits/link.h (La_x86_64_regs): Add lr_bnd.
    	(La_x86_64_retval): Add lrv_bnd0 and lrv_bnd1.
    	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Save
    	Intel MPX bound registers before _dl_profile_fixup.
    	* sysdeps/x86_64/dl-trampoline.h: Restore Intel MPX bound
    	registers after _dl_profile_fixup.  Save and restore bound
    	registers bnd0/bnd1 when calling _dl_call_pltexit.
    	* sysdeps/x86_64/link-defines.sym (BND_SIZE): New.
    	(LR_BND_OFFSET): Likewise.
    	(LRV_BND0_OFFSET): Likewise.
    	(LRV_BND1_OFFSET): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 7227709..5efa3ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-04-16  Igor Zamyatin  <igor.zamyatin@intel.com>
+
+	* sysdeps/x86_64/bits/link.h (La_x86_64_regs): Add lr_bnd.
+	(La_x86_64_retval): Add lrv_bnd0 and lrv_bnd1.
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Save
+	Intel MPX bound registers before _dl_profile_fixup.
+	* sysdeps/x86_64/dl-trampoline.h: Restore Intel MPX bound
+	registers after _dl_profile_fixup.  Save and restore bound
+	registers bnd0/bnd1 when calling _dl_call_pltexit.
+	* sysdeps/x86_64/link-defines.sym (BND_SIZE): New.
+	(LR_BND_OFFSET): Likewise.
+	(LRV_BND0_OFFSET): Likewise.
+	(LRV_BND1_OFFSET): Likewise.
+
 2014-04-16  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/tls.h (dtv, dtv_t, tcbhead_t): Move declarations
diff --git a/sysdeps/x86/bits/link.h b/sysdeps/x86/bits/link.h
index 8673b21..82522e5 100644
--- a/sysdeps/x86/bits/link.h
+++ b/sysdeps/x86/bits/link.h
@@ -93,6 +93,9 @@ typedef struct La_x86_64_regs
   uint64_t lr_rsp;
   La_x86_64_xmm lr_xmm[8];
   La_x86_64_vector lr_vector[8];
+#ifndef __ILP32__
+  __int128 lr_bnd[4];
+#endif
 } La_x86_64_regs;
 
 /* Return values for calls from PLT on x86-64.  */
@@ -106,6 +109,10 @@ typedef struct La_x86_64_retval
   long double lrv_st1;
   La_x86_64_vector lrv_vector0;
   La_x86_64_vector lrv_vector1;
+#ifndef __ILP32__
+  __int128 lrv_bnd0;
+  __int128 lrv_bnd1;
+#endif
 } La_x86_64_retval;
 
 #define La_x32_regs La_x86_64_regs
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 3c0f542..bf3cff7 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -189,6 +189,20 @@ _dl_runtime_profile:
 	movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp)
 	movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp)
 
+# ifndef __ILP32__
+#  ifdef HAVE_MPX_SUPPORT
+	bndmov %bnd0, 		   (LR_BND_OFFSET)(%rsp)  # Preserve bound
+	bndmov %bnd1, (LR_BND_OFFSET +   BND_SIZE)(%rsp)  # registers. Nops if
+	bndmov %bnd2, (LR_BND_OFFSET + BND_SIZE*2)(%rsp)  # MPX not available
+	bndmov %bnd3, (LR_BND_OFFSET + BND_SIZE*3)(%rsp)  # or disabled.
+#  else
+	.byte 0x66,0x0f,0x1b,0x84,0x24;.long (LR_BND_OFFSET)
+	.byte 0x66,0x0f,0x1b,0x8c,0x24;.long (LR_BND_OFFSET + BND_SIZE)
+	.byte 0x66,0x0f,0x1b,0x84,0x24;.long (LR_BND_OFFSET + BND_SIZE*2)
+	.byte 0x66,0x0f,0x1b,0x8c,0x24;.long (LR_BND_OFFSET + BND_SIZE*3)
+#  endif
+# endif
+
 # if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT
 	.data
 L(have_avx):
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index 161af0f..416ed0e 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -63,6 +63,20 @@
 	movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6
 	movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7
 
+#ifndef __ILP32__
+# ifdef HAVE_MPX_SUPPORT
+	bndmov 		    (LR_BND_OFFSET)(%rsp), %bnd0  # Restore bound
+	bndmov (LR_BND_OFFSET +   BND_SIZE)(%rsp), %bnd1  # registers.
+	bndmov (LR_BND_OFFSET + BND_SIZE*2)(%rsp), %bnd2
+	bndmov (LR_BND_OFFSET + BND_SIZE*3)(%rsp), %bnd3
+# else
+	.byte 0x66,0x0f,0x1a,0x84,0x24;.long (LR_BND_OFFSET)
+	.byte 0x66,0x0f,0x1a,0x8c,0x24;.long (LR_BND_OFFSET + BND_SIZE)
+	.byte 0x66,0x0f,0x1a,0x94,0x24;.long (LR_BND_OFFSET + BND_SIZE*2)
+	.byte 0x66,0x0f,0x1a,0x9c,0x24;.long (LR_BND_OFFSET + BND_SIZE*3)
+# endif
+#endif
+
 #ifdef RESTORE_AVX
 	/* Check if any xmm0-xmm7 registers are changed by audit
 	   module.  */
@@ -222,6 +236,16 @@
 	vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx)
 #endif
 
+#ifndef __ILP32__
+# ifdef HAVE_MPX_SUPPORT
+	bndmov %bnd0, LRV_BND0_OFFSET(%rcx)  # Preserve returned bounds.
+	bndmov %bnd1, LRV_BND1_OFFSET(%rcx)
+# else
+	.byte  0x66,0x0f,0x1b,0x81;.long (LRV_BND0_OFFSET)
+	.byte  0x66,0x0f,0x1b,0x89;.long (LRV_BND1_OFFSET)
+# endif
+#endif
+
 	fstpt LRV_ST0_OFFSET(%rcx)
 	fstpt LRV_ST1_OFFSET(%rcx)
 
@@ -254,6 +278,16 @@
 1:
 #endif
 
+#ifndef __ILP32__
+# ifdef HAVE_MPX_SUPPORT
+	bndmov LRV_BND0_OFFSET(%rcx), %bnd0  # Restore bound registers.
+	bndmov LRV_BND1_OFFSET(%rcx), %bnd1
+# else
+	.byte  0x66,0x0f,0x1a,0x81;.long (LRV_BND0_OFFSET)
+	.byte  0x66,0x0f,0x1a,0x89;.long (LRV_BND1_OFFSET)
+# endif
+#endif
+
 	fldt LRV_ST1_OFFSET(%rsp)
 	fldt LRV_ST0_OFFSET(%rsp)
 
diff --git a/sysdeps/x86_64/link-defines.sym b/sysdeps/x86_64/link-defines.sym
index 85d35ad..862fa22 100644
--- a/sysdeps/x86_64/link-defines.sym
+++ b/sysdeps/x86_64/link-defines.sym
@@ -6,6 +6,7 @@ VECTOR_SIZE		sizeof (La_x86_64_vector)
 XMM_SIZE		sizeof (La_x86_64_xmm)
 YMM_SIZE		sizeof (La_x86_64_ymm)
 ZMM_SIZE		sizeof (La_x86_64_zmm)
+BND_SIZE		sizeof (__int128)
 
 LR_SIZE			sizeof (struct La_x86_64_regs)
 LR_RDX_OFFSET		offsetof (struct La_x86_64_regs, lr_rdx)
@@ -18,6 +19,9 @@ LR_RBP_OFFSET		offsetof (struct La_x86_64_regs, lr_rbp)
 LR_RSP_OFFSET		offsetof (struct La_x86_64_regs, lr_rsp)
 LR_XMM_OFFSET		offsetof (struct La_x86_64_regs, lr_xmm)
 LR_VECTOR_OFFSET	offsetof (struct La_x86_64_regs, lr_vector)
+#ifndef __ILP32__
+LR_BND_OFFSET		offsetof (struct La_x86_64_regs, lr_bnd)
+#endif
 
 LRV_SIZE		sizeof (struct La_x86_64_retval)
 LRV_RAX_OFFSET		offsetof (struct La_x86_64_retval, lrv_rax)
@@ -28,3 +32,7 @@ LRV_ST0_OFFSET		offsetof (struct La_x86_64_retval, lrv_st0)
 LRV_ST1_OFFSET		offsetof (struct La_x86_64_retval, lrv_st1)
 LRV_VECTOR0_OFFSET	offsetof (struct La_x86_64_retval, lrv_vector0)
 LRV_VECTOR1_OFFSET	offsetof (struct La_x86_64_retval, lrv_vector1)
+#ifndef __ILP32__
+LRV_BND0_OFFSET		offsetof (struct La_x86_64_retval, lrv_bnd0)
+LRV_BND1_OFFSET		offsetof (struct La_x86_64_retval, lrv_bnd1)
+#endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                       |   14 ++++++++++++++
 sysdeps/x86/bits/link.h         |    7 +++++++
 sysdeps/x86_64/dl-trampoline.S  |   14 ++++++++++++++
 sysdeps/x86_64/dl-trampoline.h  |   34 ++++++++++++++++++++++++++++++++++
 sysdeps/x86_64/link-defines.sym |    8 ++++++++
 5 files changed, 77 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]