This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 03/21] nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)
On 15/10/2019 08:03, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> diff --git a/sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S b/sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S
>> new file mode 100644
>> index 0000000000..c7364bfff8
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S
>
>> +ENTRY (__syscall_cancel_arch)
>> +
>> + .globl __syscall_cancel_arch_start
>> + .type __syscall_cancel_arch_start,@function
>
> I don't think we should specify a type for this symbol. It's not a
> function.
Ack, I can't recall exactly I have added it on previous iterations.
I removed it.
>
>> +__syscall_cancel_arch_start:
>> +
>> + /* if (*cancelhandling & CANCELED_BITMASK)
>> + __syscall_do_cancel() */
>> + mov (%rdi),%eax
>> + testb $4, (%rdi)
>> + jne __syscall_do_cancel
>
> I'm pretty sure 4 should be one of the _BITMASK constants.
Right, I think we should use TCB_CANCELED_BITMASK macro for this (and
add it for architectures that do not define it already).
>
>> + /* Issue a 6 argument syscall, the nr [%rax] being the syscall
>> + number. */
>> + mov %rdi,%r11
>> + mov %rsi,%rax
>> + mov %rdx,%rdi
>> + mov %rcx,%rsi
>> + mov %r8,%rdx
>> + mov %r9,%r10
>> + mov 8(%rsp),%r8
>> + mov 16(%rsp),%r9
>> + mov %r11,8(%rsp)
>> + syscall
>> +
>> + .globl __syscall_cancel_arch_end
>> + .type __syscall_cancel_arch_end,@function
>
> Again, no type here please. It will confuse the disassembler.
Ack.
>
> Thanks,
> Florian
>