Re: [PATCH v6 01/10] x86/retpoline: Add initial retpoline support

From: Peter Zijlstra
Date: Mon Jan 08 2018 - 06:03:25 EST


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