Re: [GIT PULL] x86/asm changes for v5.6

From: Linus Torvalds
Date: Thu Jan 30 2020 - 13:03:17 EST


On Thu, Jan 30, 2020 at 9:39 AM Borislav Petkov <bp@xxxxxxx> wrote:
>
> Yeah, makes sense. It would help if one slaps a relative JMP as *not*
> the first insn in an alternatives replacement and the build to warn that
> it can't work.

Maybe with the exception that a short conditional jump inside the
alternative code itself is fine.

Because a branch-over inside the alternative sequence (or a loop -
think inline cmpxchg loop or whatever) would be fine, since it's
unaffected by code placement.

Linus