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

Re: [PATCH 00/10] nptl: Fix Race conditions in pthread cancellation (BZ#12683)


On Thu, 17 Sep 2015, Adhemerval Zanella wrote:

> It will require some help for alpha, hppa, ia64, m68k, microblaze, nios2, sh,
> sparc, and tile. I summarized in wiki page [2] the steps required to adjust 
> the remaining architectures, but based on arm/aarch64 the minimal adjustments
> required are:

Will you put proper instructions at 
<https://sourceware.org/glibc/wiki/PortStatus> (describing what's required 
for architecture-specific changes, not other parts of the patch series), 
with a list of architectures needing help?  And do you need help for MIPS 
or not (it's not in either of your architecture lists)?

> 1. Write a new syscall implementation at sysdeps/unix/sysv/linux/<arch>/syscall_cancel.S
>    that basically do:
> 
> long int __syscall_cancel_arch (volatile unsigned int *cancelhandling,
>   __syscall_arg_t nr, __syscall_arg_t arg1, __syscall_arg_t arg2, 
>   __syscall_arg_t arg3, __syscall_arg_t arg4, __syscall_arg_t arg5,
>   __syscall_arg_t arg6)
> {
>   if (*cancelhandling & CANCELED_BITMASK)
>     __syscall_do_cancel()
> 
>   return INLINE_SYSCALL (nr, 6, arg1, arg2, arg3, arg4, arg5, arg6);

Do you mean INLINE_SYSCALL (setting errno, returning -1 on error) or 
INTERNAL_SYSCALL?  If INTERNAL_SYSCALL, what exactly are the semantics for 
architectures such as MIPS that use two registers for returns (with a 
separate register for an error flag, and the normal return register having 
the non-negated syscall number in that case)?  I didn't spot any such 
architectures in the examples you'd already converted - if I missed any, 
it would be helpful for your instructions for architecture maintainers to 
point explicitly to the already-converted architectures that provide the 
most generic examples for each of the two syscall return conventions.

> 4. Define both SYSCALL_CANCEL_ERROR(__val) and SYSCALL_CANCEL_ERRNO(__val)
>    macros.

Likewise, what are the semantics of these for architectures where syscall 
return uses two registers?

I note that you have __syscall_cancel, in the IS_IN (rtld) case, returning 
the raw result of INTERNAL_SYSCALL_NCS, having discarded error 
information.  I don't see how that is supposed to work in the two-register 
case.

I think there should be a comment in the sources (maybe on a default 
definition of the above interfaces, or on some code that uses them) 
explaining the semantics, in addition to details on or linked from the 
PortStatus wiki page at the point the changes go in.

-- 
Joseph S. Myers
joseph@codesourcery.com


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