This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 04/21] nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)
- From: Zack Weinberg <zackw at panix dot com>
- To: libc-alpha at sourceware dot org
- Cc: adhemerval dot zanella at linaro dot org
- Date: Sun, 6 May 2018 22:49:08 -0400
- Subject: Re: [PATCH v2 04/21] nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)
- References: <20180507024909.5598-1-zackw@panix.com>
- References: <1519679016-12241-5-git-send-email-adhemerval.zanella@linaro.org>
On 26 Feb 2018, Adhemerval Zanella wrote:
> This patches adds the x86_64 modification required for the BZ#12683.
> It basically provide the required ucontext_get_pc symbol and remove
> the arch-specific libc-cancellation implementations.
These changes all look fine to me.
> lock;orl $4, %fs:776
>
> Where with patch changes it now compiles to:
>
> mov %fs:16,%rax
> lock;orl $4, 776(%rax)
That might actually be faster on some microarchitectures due to not
having multiple unusual prefixes on one instruction. I wouldn't worry
about it.
> In fact all x86_64 THREAD_ATOMIC_* macros
> do not respect the input descr and possible will fail when used with
> a 'descr' difference than THREAD_SELF.
Maybe we should correct or remove all of them, then? They sound like
they're bugs waiting to happen.
zw