This is the mail archive of the glibc-bugs@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]

[Bug libc/19137] i386/epoll_pwait.S doesn't support cancellation


https://sourceware.org/bugzilla/show_bug.cgi?id=19137

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
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, hjl/i386/master has been created
        at  a67f2dccf239ef500579e994ebf379be06771ed6 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a67f2dccf239ef500579e994ebf379be06771ed6

commit a67f2dccf239ef500579e994ebf379be06771ed6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Aug 12 12:10:06 2015 -0700

    Remove i386/epoll_pwait.S

    Only i386 implements epoll_pwait in assembly code withot cancellation
    support.  All other architectures implement epoll_pwait in epoll_pwait.c
    with

    int epoll_pwait (int epfd, struct epoll_event *events,
                 int maxevents, int timeout,
                 const sigset_t *set)
    {
      return SYSCALL_CANCEL (epoll_pwait, epfd, events, maxevents,
                         timeout, set, _NSIG / 8);
    }

    Although there is no test for epoll_pwait in glibc, since SYSCALL_CANCEL
    works on i386 and epoll_pwait.c works for other architectures, it is
    safe to assume that epoll_pwait.c with SYSCALL_CANCEL also works on
    i386.

        [BZ #19137]
        * sysdeps/unix/sysv/linux/i386/Makefile (CFLAGS-epoll_pwait.c):
        Add -fomit-frame-pointer.
        * sysdeps/unix/sysv/linux/i386/epoll_pwait.S: Remove file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d3285084701a1283a6a66f214170b5e973ba72ea

commit d3285084701a1283a6a66f214170b5e973ba72ea
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Sep 14 07:13:04 2015 -0700

    Optimize i386 syscall inlining

    Since GCC 5 and above can properly spill %ebx when needed, we can inline
    syscalls with 6 arguments if GCC 5 or above is used to compile glibc.
    This patch rewrites INTERNAL_SYSCALL macros and skips __libc_do_syscall
    for GCC 5.

    For sysdeps/unix/sysv/linux/i386/brk.c, with -O2 -march=i686
    -mtune=generic, GCC 5.2 now generates:

    <__brk>:
       0:       push   %ebx
       1:       mov    $0x2d,%eax
       6:       mov    0x8(%esp),%ebx
       a:       call   b <__brk+0xb>    b: R_386_PC32   __x86.get_pc_thunk.dx
       f:       add    $0x2,%edx        11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
      15:       call   *%gs:0x10
      1c:       mov    0x0(%edx),%edx   1e: R_386_GOT32 __curbrk
      22:       cmp    %eax,%ebx
      24:       mov    %eax,(%edx)
      26:       ja     30 <__brk+0x30>
      28:       xor    %eax,%eax
      2a:       pop    %ebx
      2b:       ret

    instead of

    <__brk>:
       0:       push   %ebx
       1:       mov    0x8(%esp),%ecx
       5:       call   6 <__brk+0x6>    6: R_386_PC32   __x86.get_pc_thunk.bx
       a:       add    $0x2,%ebx        c: R_386_GOTPC  _GLOBAL_OFFSET_TABLE_
      10:       xchg   %ecx,%ebx
      12:       mov    $0x2d,%eax
      17:       call   *%gs:0x10
      1e:       xchg   %ecx,%ebx
      20:       mov    %eax,%edx
      22:       mov    0x0(%ebx),%eax   24: R_386_GOT32 __curbrk
      28:       mov    %edx,(%eax)
      2a:       xor    %eax,%eax
      2c:       cmp    %edx,%ecx
      2e:       ja     38 <__brk+0x38>
      30:       pop    %ebx
      31:       ret

    The new one is shorter by 2 instructions.

        * sysdeps/unix/sysv/linux/i386/libc-do-syscall.S
        (__libc_do_syscall): Defined only if !__GNUC_PREREQ (5,0).
        * sysdeps/unix/sysv/linux/i386/sysdep.h: Define assembler macros
        only if !__GNUC_PREREQ (5,0).
        (INTERNAL_SYSCALL_MAIN_6): Optimize for GCC 5.
        (INTERNAL_SYSCALL_MAIN_INLINE): Likewise.
        (INTERNAL_SYSCALL_NCS): Likewise.
        (LOADREGS_0): New macro for GCC 5.
        (ASMARGS_0): Likewise.
        (LOADREGS_1): Likewise.
        (ASMARGS_1): Likewise.
        (LOADREGS_2): Likewise.
        (ASMARGS_2): Likewise.
        (LOADREGS_3): Likewise.
        (ASMARGS_3): Likewise.
        (LOADREGS_4): Likewise.
        (ASMARGS_4): Likewise.
        (LOADREGS_5): Likewise.
        (ASMARGS_5): Likewise.
        (LOADREGS_6): Likewise.
        (ASMARGS_6): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=673dc98b2081c7b6d6c52b7ff29ef62a1fb52c98

commit 673dc98b2081c7b6d6c52b7ff29ef62a1fb52c98
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Aug 21 14:46:05 2015 -0700

    Avoid reading errno in syscall implementations

    Reading errno is expensive for x86 PIC.  With INTERNAL_SYSCALL,
    INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO and
    INLINE_SYSCALL_ERROR_RETURN_VALUE, we can avoid reading errno.

        * sysdeps/unix/sysv/linux/eventfd.c (eventfd): Use
        INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P and
        INTERNAL_SYSCALL_ERRNO to avoid reading errno.
        * sysdeps/unix/sysv/linux/fstatfs64.c (__fstatfs64): Likewise.
        * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64):
        Likewise.
        * sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64):
        Likewise.
        * sysdeps/unix/sysv/linux/signalfd.c (signalfd): Likewise.
        * sysdeps/unix/sysv/linux/statfs64.c (__statfs64): Likewise.

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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