Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756709AbeAHLDV (ORCPT + 1 other); Mon, 8 Jan 2018 06:03:21 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:60085 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756571AbeAHLDU (ORCPT ); Mon, 8 Jan 2018 06:03:20 -0500 Date: Mon, 8 Jan 2018 12:03:09 +0100 From: Peter Zijlstra To: David Woodhouse Cc: Andi Kleen , Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , tglx@linutronix.de, Kees Cook , Rik van Riel , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk Subject: Re: [PATCH v6 01/10] x86/retpoline: Add initial retpoline support Message-ID: <20180108110309.GH3040@hirez.programming.kicks-ass.net> References: <1515363085-4219-1-git-send-email-dwmw@amazon.co.uk> <1515363085-4219-2-git-send-email-dwmw@amazon.co.uk> <20180108104512.GG3040@hirez.programming.kicks-ass.net> <1515408782.7317.33.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1515408782.7317.33.camel@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 08, 2018 at 10:53:02AM +0000, David Woodhouse wrote: > On Mon, 2018-01-08 at 11:45 +0100, Peter Zijlstra wrote: > > > > > > Should this not use local name labels instead? > > > > .macro RETPOLINE_JMP reg:req > > ????????call????.Ldo_rop_\@ > > .Lspec_trap_\@: > > ????????pause > > ????????jmp .Lspec_trap_\@ > > .Ldo_rop_\@: > > ????????mov?????\reg, (%_ASM_SP) > > ????????ret > > .endm > > Not if you want to be able to use them twice in the same .S file. Should work fine, the \@ expands to a per-instance magic thing IIRC. All the PTI helpers do this too and that works just fine, see arch/x86/entry/calling.h