From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751169AbdEaODt (ORCPT ); Wed, 31 May 2017 10:03:49 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:53946 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbdEaODr (ORCPT ); Wed, 31 May 2017 10:03:47 -0400 Date: Wed, 31 May 2017 16:03:18 +0200 From: Peter Zijlstra To: Kees Cook Cc: LKML , Christoph Hellwig , "Eric W. Biederman" , Andrew Morton , Josh Poimboeuf , PaX Team , Jann Horn , Eric Biggers , Elena Reshetova , Hans Liljestrand , David Windsor , Greg KH , Ingo Molnar , Alexey Dobriyan , "Serge E. Hallyn" , arozansk@redhat.com, Davidlohr Bueso , Manfred Spraul , "axboe@kernel.dk" , James Bottomley , "x86@kernel.org" , Ingo Molnar , Arnd Bergmann , "David S. Miller" , Rik van Riel , linux-arch , "kernel-hardening@lists.openwall.com" Subject: Re: [PATCH v5 2/3] x86/asm: Add suffix macro for GEN_*_RMWcc() Message-ID: <20170531140318.5piqb4ksynq4evwi@hirez.programming.kicks-ass.net> References: <1496180392-98718-1-git-send-email-keescook@chromium.org> <1496180392-98718-3-git-send-email-keescook@chromium.org> <20170531111309.3kyfgxu5dkthu2dn@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 31, 2017 at 06:17:16AM -0700, Kees Cook wrote: > On Wed, May 31, 2017 at 4:13 AM, Peter Zijlstra wrote: > > On Tue, May 30, 2017 at 02:39:51PM -0700, Kees Cook wrote: > >> The coming x86 refcount protection needs to be able to add trailing > >> instructions to the GEN_*_RMWcc() operations. This extracts the > >> difference between the goto/non-goto cases so the helper macros > >> can be defined outside the #ifdef cases. Additionally adds argument > >> naming to the resulting asm for referencing from suffixed > >> instructions, and adds clobbers for "cc", and "cx" to let suffixes > >> use _ASM_CX, and retain any set flags. > > > > Another option is to simply require __GCC_ASM_FLAG_OUTPUT__ for the fast > > refcount stuff. That would result in simpler and more readable code. > > What versions of GCC support that? IIRC 6+