[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libglvnd: Changes to 'debian-unstable'



 configure.ac                             |   13 +--
 debian/changelog                         |    4 -
 debian/control                           |    5 -
 debian/rules                             |    2 
 src/GLdispatch/vnd-glapi/entry_files.mk  |    2 
 src/GLdispatch/vnd-glapi/entry_x86_tls.c |  108 ++++++++++---------------------
 src/GLdispatch/vnd-glapi/entry_x86_tsd.c |   25 ++++---
 7 files changed, 65 insertions(+), 94 deletions(-)

New commits:
commit e50577db79a142f9d095728cf1d83fafd2cdd40e
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Sat Dec 3 02:10:26 2016 +0200

    release to experimental
    
    fix maintainer

diff --git a/debian/changelog b/debian/changelog
index 0654579..5fc5fbb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-libglvnd (0.2.999+git20161203-1) UNRELEASED; urgency=low
+libglvnd (0.2.999+git20161203-1) experimental; urgency=low
 
   * Initial release (Closes: #812530)
 
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Thu, 29 Aug 2013 10:59:47 +0300
+ -- Timo Aaltonen <tjaalton@debian.org>  Sat, 03 Dec 2016 02:09:57 +0200
diff --git a/debian/control b/debian/control
index 22470a5..9d2073e 100644
--- a/debian/control
+++ b/debian/control
@@ -1,6 +1,7 @@
 Source: libglvnd
 Priority: extra
-Maintainer: Timo Aaltonen <tjaalton@ubuntu.com>
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: Timo Aaltonen <tjaalton@debian.org>
 Build-Depends:
  debhelper (>= 10),
  pkg-config,

commit 4fdecc73802d82f94f1e1c629baca82558db3d76
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Sat Dec 3 02:08:59 2016 +0200

    bump version

diff --git a/debian/changelog b/debian/changelog
index 816b942..0654579 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libglvnd (0.2.999+git20161201-1) UNRELEASED; urgency=low
+libglvnd (0.2.999+git20161203-1) UNRELEASED; urgency=low
 
   * Initial release (Closes: #812530)
 

commit bb38f3849ac26b31ab0b055ed5d1299ecc29cfa7
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Sat Dec 3 01:57:23 2016 +0200

    Drop EGL support for now, mesa doesn't have it yet

diff --git a/debian/rules b/debian/rules
index 3fdbfca..b0bb8af 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,8 @@
 
 override_dh_install:
 	find debian/tmp -name '*.la' -delete
+	find debian/tmp -name 'libEGL*' -delete
+	find debian/tmp -name 'libGLES*' -delete
 	dh_install --fail-missing
 
 # needs X

commit d5516d18c5794b29a25624906d1ae963349e6c50
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Fri Dec 2 00:03:59 2016 +0200

    bump policy to 3.9.8

diff --git a/debian/control b/debian/control
index 09760f8..22470a5 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends:
  python-dev,
  python-libxml2,
  x11proto-gl-dev,
-Standards-Version: 3.9.7
+Standards-Version: 3.9.8
 Section: libs
 Homepage: https://github.com/NVIDIA/libglvnd
 Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/lib/libglvnd.git

commit 9a17198be3622ffa00f9db36e6b55773d4dcf596
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Tue Nov 22 12:39:25 2016 -0700

    GLdispatch: Fix TEXTREL in the x86 TSD stubs.
    
    Rewrite the x86 TSD dispatch stubs so that they go through the GOT and PLT
    tables to look up _glapi_Current and _glapi_get_current, instead of using
    absolute addresses for them.
    
    Fixes https://github.com/NVIDIA/libglvnd/issues/108

diff --git a/src/GLdispatch/vnd-glapi/entry_x86_tsd.c b/src/GLdispatch/vnd-glapi/entry_x86_tsd.c
index 8d18854..3157c37 100644
--- a/src/GLdispatch/vnd-glapi/entry_x86_tsd.c
+++ b/src/GLdispatch/vnd-glapi/entry_x86_tsd.c
@@ -38,7 +38,7 @@
 #include "glapi.h"
 #include "glvnd/GLdispatchABI.h"
 
-#define X86_ENTRY_SIZE 32
+#define X86_ENTRY_SIZE 64
 
 __asm__(".section wtext,\"ax\",@progbits\n");
 __asm__(".balign 4096\n"
@@ -53,13 +53,19 @@ __asm__(".balign 4096\n"
    func ":"
 
 #define STUB_ASM_CODE(slot)         \
-    "movl _glapi_Current, %eax\n\t" \
-    "testl %eax, %eax\n\t"           \
-    "je 1f\n\t"                      \
-    "jmp *(4 * " slot ")(%eax)\n"    \
-    "1:\n\t"                         \
-    "call _glapi_get_current\n\t" \
-    "jmp *(4 * " slot ")(%eax)"
+    "push %ebx\n" \
+    "call 1f\n" \
+    "1:\n" \
+    "popl %ebx\n" \
+    "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx\n" \
+    "movl _glapi_Current@GOT(%ebx), %eax\n" \
+    "mov (%eax), %eax\n" \
+    "testl %eax, %eax\n" \
+    "jne 1f\n" \
+    "call _glapi_get_current@PLT\n" \
+    "1:\n" \
+    "pop %ebx\n" \
+    "jmp *(4 * " slot ")(%eax)\n"
 
 #define MAPI_TMP_STUB_ASM_GCC
 #include "mapi_tmp.h"
@@ -74,6 +80,9 @@ __asm__(".text\n");
 const int entry_type = __GLDISPATCH_STUB_X86;
 const int entry_stub_size = X86_ENTRY_SIZE;
 
+// Note that the generated stubs are simpler than the assembly stubs above.
+// For the generated stubs, we can patch in the addresses of _glapi_Current and
+// _glapi_get_current, so we don't need to go through the GOT and PLT lookups.
 static const unsigned char ENTRY_TEMPLATE[] =
 {
     0xa1, 0x40, 0x30, 0x20, 0x10,       // <ENTRY>:    mov    _glapi_Current, %eax

commit f9117614be359e35a772d0748098ca4343f03a42
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Tue Sep 27 15:56:01 2016 -0600

    GLdispatch: Fix the x86 TLS stubs.
    
    Fix the generated code for the x86 TLS dispatch stubs.
    
    Update the x86 TLS stubs to use the same common code as the rest of the x86 and
    x86-64 entrypoints.
    
    Fixes https://github.com/NVIDIA/libglvnd/issues/18

diff --git a/configure.ac b/configure.ac
index 73cafe8..1c0e6bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,18 +140,13 @@ AC_MSG_RESULT($HAVE_INIT_TLS)
 
 AC_MSG_CHECKING([for entrypoint stub type])
 case "x$asm_arch" in
-xx86)
-    # The x86 TLS stubs don't work, so use the TSD stubs instead.
-    gldispatch_entry_type=x86_tsd
-    gldispatch_use_tls=no
-    ;;
-xx86_64)
-    # For x86-64, both the TLS and TSD stubs work.
+xx86 | xx86_64)
+    # For x86 and x86-64, both the TLS and TSD stubs work.
     if test "x$HAVE_INIT_TLS" = "xyes" ; then
-        gldispatch_entry_type=x86_64_tls
+        gldispatch_entry_type=${asm_arch}_tls
         gldispatch_use_tls=yes
     else
-        gldispatch_entry_type=x86_64_tsd
+        gldispatch_entry_type=${asm_arch}_tsd
         gldispatch_use_tls=no
     fi
     ;;
diff --git a/src/GLdispatch/vnd-glapi/entry_files.mk b/src/GLdispatch/vnd-glapi/entry_files.mk
index 38b6bf3..0a7c1e4 100644
--- a/src/GLdispatch/vnd-glapi/entry_files.mk
+++ b/src/GLdispatch/vnd-glapi/entry_files.mk
@@ -4,6 +4,8 @@
 
 if GLDISPATCH_TYPE_X86_TLS
 MAPI_GLDISPATCH_ENTRY_FILES = entry_x86_tls.c
+MAPI_GLDISPATCH_ENTRY_FILES += entry_x86_64_common.c
+MAPI_GLDISPATCH_ENTRY_FILES += entry_common.c
 endif
 
 if GLDISPATCH_TYPE_X86_TSD
diff --git a/src/GLdispatch/vnd-glapi/entry_x86_tls.c b/src/GLdispatch/vnd-glapi/entry_x86_tls.c
index b303bfa..6c9bd4b 100644
--- a/src/GLdispatch/vnd-glapi/entry_x86_tls.c
+++ b/src/GLdispatch/vnd-glapi/entry_x86_tls.c
@@ -25,19 +25,28 @@
  *    Chia-I Wu <olv@lunarg.com>
  */
 
-#include <string.h>
+#include "entry.h"
+#include "entry_common.h"
+
 #include <assert.h>
-#include "u_macros.h"
+#include <sys/mman.h>
+#include <unistd.h>
+#include <string.h>
+
 #include "utils_misc.h"
+#include "u_macros.h"
+#include "glapi.h"
+#include "glvnd/GLdispatchABI.h"
 
-#define ENTRY_STUB_ALIGN 32
+#define ENTRY_STUB_ALIGN 16
 #define ENTRY_STUB_SIZE ENTRY_STUB_ALIGN
 #define ENTRY_STUB_ALIGN_DIRECTIVE ".balign " U_STRINGIFY(ENTRY_STUB_ALIGN) "\n"
 
-__asm__(".section wtext, \"awx\", @progbits");
-
-__asm__(ENTRY_STUB_ALIGN_DIRECTIVE
-        "x86_entry_start:");
+__asm__(".section wtext,\"ax\",@progbits\n");
+__asm__(".balign 4096\n"
+       ".globl public_entry_start\n"
+       ".hidden public_entry_start\n"
+        "public_entry_start:");
 
 #define STUB_ASM_ENTRY(func)     \
    ".globl " func "\n"           \
@@ -51,9 +60,13 @@ __asm__(ENTRY_STUB_ALIGN_DIRECTIVE
    "jmp *(4 * " slot ")(%eax)"
 
 #define MAPI_TMP_STUB_ASM_GCC
-#define MAPI_TMP_TABLE
 #include "mapi_tmp.h"
 
+__asm__(".balign 4096\n"
+       ".globl public_entry_end\n"
+       ".hidden public_entry_end\n"
+        "public_entry_end:");
+
 __asm__(".text\n");
 
 __asm__("x86_current_tls:\n\t"
@@ -62,80 +75,29 @@ __asm__("x86_current_tls:\n\t"
         "1:\n\t"
         "popl %eax\n\t"
     "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t"
-    "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t"
+    "movl _glapi_tls_Current@GOTNTPOFF(%eax), %eax\n\t"
     "ret");
 
-
-#include "u_execmem.h"
-
-extern unsigned long
+extern uint32_t
 x86_current_tls();
 
-static char x86_entry_start[];
-
-const int entry_type = ENTRY_X86_TLS;
+const int entry_type = __GLDISPATCH_STUB_X86;
 const int entry_stub_size = ENTRY_STUB_SIZE;
 
-void entry_generate_default_code(char *entry, int slot)
+static const unsigned char ENTRY_TEMPLATE[] =
 {
-    unsigned int *p;
-    unsigned long tls_addr;
-    char tmpl[] = {
-        0x65, 0xa1, 0x0, 0x0, 0x0, 0x0, // movl %gs:0x0,%eax
-        0xff, 0x20,                     // jmp *(%eax)
-        0x90, 0x90, 0x90, 0x90,         // nop's
-        0x90
-    };
-
-    STATIC_ASSERT(sizeof(mapi_func) == 4);
-    STATIC_ASSERT(ENTRY_STUB_SIZE >= sizeof(tmpl));
-
-    tls_addr = x86_current_tls();
-
-    p = (unsigned int *)&tmpl[2];
-    *p = (unsigned int)tls_addr;
-
-    p = (unsigned int *)&tmpl[8];
-    *p = (unsigned int)(4 * slot);
+    0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, /* movl %gs:0x0, %eax */
+    0xff, 0xa0, 0x34, 0x12, 0x00, 0x00, /* jmp *0x1234(%eax) */
+};
+static const int TEMPLATE_OFFSET_TLS_OFFSET = 2;
+static const int TEMPLATE_OFFSET_SLOT = 8;
 
-    memcpy(entry, tmpl, sizeof(tmpl));
-}
-
-void
-entry_init_public(void)
-{
-    int slot;
-
-    // Patch the stubs with a more optimal code sequence
-    for (slot = 0; slot < MAPI_TABLE_NUM_STATIC; slot++)
-       entry_generate_default_code((char *) entry_get_public(slot), slot);
-}
-
-mapi_func
-entry_get_public(int slot)
-{
-   return (mapi_func) (x86_entry_start + slot * ENTRY_STUB_SIZE);
-}
-
-#if !defined(STATIC_DISPATCH_ONLY)
-void
-entry_patch(mapi_func entry, int slot)
-{
-    entry_generate_default_code((char *)entry, slot);
-}
-
-mapi_func
-entry_generate(int slot)
+void entry_generate_default_code(char *entry, int slot)
 {
-   void *code;
-
-   code = u_execmem_alloc(ENTRY_STUB_SIZE);
-   if (!code)
-      return NULL;
-
-   entry_generate_default_code(code, slot);
+    char *writeEntry = u_execmem_get_writable(entry);
 
-   return (mapi_func) code;
+    memcpy(writeEntry, ENTRY_TEMPLATE, sizeof(ENTRY_TEMPLATE));
+    *((uint32_t *) (writeEntry + TEMPLATE_OFFSET_TLS_OFFSET)) = x86_current_tls();
+    *((uint32_t *) (writeEntry + TEMPLATE_OFFSET_SLOT)) = (uint32_t) (slot * sizeof(mapi_func));
 }
-#endif // !defined(STATIC_DISPATCH_ONLY)
 


Reply to: