This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, rs6000] Allow libitm to use HTM on newer hw and kernels
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Peter Bergner <bergner at linux dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Dec 2018 14:52:10 -0600
- Subject: Re: [PATCH, rs6000] Allow libitm to use HTM on newer hw and kernels
- References: <email@example.com>
On Wed, Dec 12, 2018 at 01:47:02PM -0600, Peter Bergner wrote:
> Libitm on POWER hardware looks for the "htm" bit in AT_HWCAP2 to determine
> whether it can use HTM when executing code within __transaction_atomic
> code blocks. However, on newer hardware and kernels, the "htm" bit is no
> longer set and instead the "htm-no-suspend" bit is set, so we currently
> don't use HTM on new hw and kernels. The following patch adds support
> for htm-no-suspend to libitm. I have also added code to use the
> __builtin_cpu_supports() builtin if it is available, since that is
> much faster than using the getauxval libc call.
> This passed bootstrap and regtesting with no errors and someone within
> IBM how had a POWER9 box with a newish kernel how ran into the problem
> confirmed it works for his test case.
> Ok for mainline? Should be backport this?
Okay for trunk (but see comment below). I think it should be backported
yes, to 8 at least, probably 7. Okay for those too.
> +/* This is a fairly new feature bit, so handle it not being defined. */
> +#ifndef PPC_FEATURE2_HTM_NO_SUSPEND
> +# define PPC_FEATURE2_HTM_NO_SUSPEND 0
Doing it this way can be pretty surprising for users not aware you defined
it to 0. Since there are no other users yet it's no big deal.