From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108725 invoked by alias); 12 Dec 2018 20:52:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 108698 invoked by uid 89); 12 Dec 2018 20:52:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=his X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Dec 2018 20:52:23 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id wBCKqHQb016210; Wed, 12 Dec 2018 14:52:18 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id wBCKqA3W016204; Wed, 12 Dec 2018 14:52:10 -0600 Date: Wed, 12 Dec 2018 20:52:00 -0000 From: Segher Boessenkool To: Peter Bergner Cc: GCC Patches Subject: Re: [PATCH, rs6000] Allow libitm to use HTM on newer hw and kernels Message-ID: <20181212205208.GT3803@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00871.txt.bz2 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 > +#endif 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. Segher