lkml.org 
[lkml]   [2018]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86/retpoline: Fix NOSPEC_JMP for tip
On Tue, Jan 9, 2018 at 4:31 PM, Andi Kleen <andi@firstfloor.org> wrote:
>
> The following patch fixes it for me. Something doesn't
> seem to work with ALTERNATIVE_2. It adds only a few bytes
> more code, so seems acceptable.

Ugh. It's kind of stupid, though.

Why is the code sequence not simply:

ALTERNATIVE "", "lfence", X86_FEATURE_RETPOLINE_AMD
ALTERNATIVE __stringify(jmp *\reg), __stringify(RETPOLINE_JMP \reg),
X86_FEATURE_RETPOLINE

ie make that X86_FEATURE_RETPOLINE_AMD _only_ emit the "lfence", and
simply fall through to what will be the "jmp *\reg" of the
non-RETPOLINE version.

Then just make sure X86_FEATURE_RETPOLINE_AMD disables X86_FEATURE_RETPOLINE.

That is both simpler an dsmaller, no?

Linus

\
 
 \ /
  Last update: 2018-01-14 23:20    [W:0.192 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site