This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: More elision improvements
- From: Torvald Riegel <triegel at redhat dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Date: Fri, 20 Nov 2015 16:35:11 +0100
- Subject: Re: [PATCH] powerpc: More elision improvements
- Authentication-results: sourceware.org; auth=none
- References: <56314D77 dot 5080703 at linux dot vnet dot ibm dot com>
On Wed, 2015-10-28 at 17:34 -0500, Paul E. Murphy wrote:
> diff --git a/sysdeps/unix/sysv/linux/powerpc/htm.h b/sysdeps/unix/sysv/linux/powerpc/htm.h
> index 57d5cd6..5127b4b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/htm.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/htm.h
> @@ -129,10 +129,12 @@
>
> #endif /* __ASSEMBLER__ */
>
> -/* Definitions used for TEXASR Failure code (bits 0:6), they need to be even
> - because tabort. always sets the first bit. */
> -#define _ABORT_LOCK_BUSY 0x3f /* Lock already used. */
> -#define _ABORT_NESTED_TRYLOCK 0x3e /* Write operation in trylock. */
> -#define _ABORT_SYSCALL 0x3d /* Syscall issued. */
> +/* Definitions used for TEXASR Failure code (bits 0:7). If the failure
> + should be persistent, the abort code must be odd. 0xd0 through 0xff
> + are reserved for the kernel and potential hypervisor. */
> +#define _ABORT_PERSISTENT 0x01 /* An unspecified persistent abort. */
> +#define _ABORT_LOCK_BUSY 0x34 /* Busy lock, not persistent. */
> +#define _ABORT_NESTED_TRYLOCK (0x32 | _ABORT_PERSISTENT)
> +#define _ABORT_SYSCALL (0x30 | _ABORT_PERSISTENT)
>
> #endif
I think the abort code should be well documented, and they are
effectively ABI in some cases. Whether something is persistent or not
should be ABI because it requires any (unrelated) outermost
transactional code to do the right thing. For other abort codes, it
would not be strictly necessary to make them part of the ABI, but
probably helpful for performance; we'll have to try to pick retry
strategies that work across projects (eg, gcc, libitm, libstdc++, ...).
Thus, are these documented anywhere, or do you plan to add such
documentation? (Making glibc the canonical source would be fine too for
me, as long as everyone is aware of that.)
(This is not a powerpc-specific problem, and I've asked Andi Kleen the
same. It's also not a reason to not commit this patch because I assume
that there aren't yet any users out there in the wild that depend on the
previous failure codes).