[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200407135211.GB20730@hirez.programming.kicks-ass.net>
Date: Tue, 7 Apr 2020 15:52:11 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Alexandre Chartre <alexandre.chartre@...cle.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, jpoimboe@...hat.com,
jthierry@...hat.com, tglx@...utronix.de
Subject: Re: [PATCH V2 9/9] x86/speculation: Remove all
ANNOTATE_NOSPEC_ALTERNATIVE directives
On Tue, Apr 07, 2020 at 09:31:42AM +0200, Alexandre Chartre wrote:
> - ANNOTATE_NOSPEC_ALTERNATIVE
> ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *\reg), \
> __stringify(RETPOLINE_JMP \reg), X86_FEATURE_RETPOLINE, \
> __stringify(lfence; ANNOTATE_RETPOLINE_SAFE; jmp *\reg), X86_FEATURE_RETPOLINE_AMD
Possibly we can write this like:
ALTERNATIVE("", "lfence", X86_FEATURE_RETPOLINE_AMD);
ALTERNATIVE("jmp *\reg", "jmp __x86_retpoline_jmp_\reg", X86_FEATURE_RETPOLINE);
With an out-of-line copy of the retpoline, just like the THUNKs the
compiler uses, except of course, it can't be those, because we actually
want to use the alternative to implement those.
By moving the retpoline magic out-of-line we ensure it has a unique
address and the ORC stuff should work.
I'm just not sure what to do about the RETPOLINE_CALL variant.
Powered by blists - more mailing lists