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 ports/15054] MIPS/Linux syscall restart convention not respected by INTERNAL_SYSCALL_NCS


http://sourceware.org/bugzilla/show_bug.cgi?id=15054

Maciej W. Rozycki <macro@linux-mips.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Maciej W. Rozycki <macro@linux-mips.org> 2013-02-05 15:25:00 UTC ---
I think the removal of code complication is not worth the hassle and
given how the MIPS ABI has been laid out there is normally no runtime
overhead from this arrangement, merely instruction shuffling.

I think addressing the issue of multiple stack pointer adjustments made
for o32 syscalls that make use of more than four arguments (the alloca
or FORCE_FRAME_POINTER hack) and the resulting space and time overhead
of unnecessary register juggling would be a better use of anyone's time
and resources.

Fixed thus:

commit b82ba2f011fc4628ceece07412846d0b4d50cac2
Author: Maciej W. Rozycki <macro@codesourcery.com>
Date:   Tue Feb 5 14:41:32 2013 +0000

    MIPS: Respect the legacy syscall restart convention.

    That convention requires the instruction immediately preceding SYSCALL
    to initialize $v0 with the syscall number.  Then if a restart triggers,
    $v0 will have been clobbered by the syscall interrupted, and needs to be
    reinititalized.  The kernel will decrement the PC by 4 before switching
    back to the user mode so that $v0 has been reloaded before SYSCALL is
    executed again.  This implies the place $v0 is loaded from must be
    preserved across a syscall, e.g. an immediate, static register, stack
    slot, etc.

    The restriction was lifted with Linux 2.6.36 kernel release and no
    special requirements are placed around the SYSCALL instruction anymore,
    however we still support older kernel binaries.

ChangeLog.mips:

2013-02-05  Maciej W. Rozycki  <macro@codesourcery.com>

    [BZ #15054]
    * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (MOVE32):
    New macro.
    (INTERNAL_SYSCALL_NCS): Use it.  Rewrite to respect the syscall
    restart convention.
    (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
    convention.
    (internal_syscall0, internal_syscall1): Likewise.
    (internal_syscall2, internal_syscall3): Likewise.
    (internal_syscall4, internal_syscall5): Likewise.
    (internal_syscall6, internal_syscall7): Likewise.
    * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (MOVE32):
    New macro.
    (INTERNAL_SYSCALL_NCS): Use it.  Rewrite to respect the syscall
    restart convention.
    (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
    convention.
    (internal_syscall0, internal_syscall1): Likewise.
    (internal_syscall2, internal_syscall3): Likewise.
    (internal_syscall4, internal_syscall5): Likewise.
    (internal_syscall6): Likewise.
    * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (MOVE32):
    New macro.
    (INTERNAL_SYSCALL_NCS): Use it.  Rewrite to respect the syscall
    restart convention.
    (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
    convention.
    (internal_syscall0, internal_syscall1): Likewise.
    (internal_syscall2, internal_syscall3): Likewise.
    (internal_syscall4, internal_syscall5): Likewise.
    (internal_syscall6): Likewise.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]