Re: [PATCH] x86/alternatives: Fix optimize_nops() checking

From: Linus Torvalds
Date: Wed Jan 10 2018 - 16:11:55 EST


On Wed, Jan 10, 2018 at 1:08 PM, David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
>
> There are a few of the form 'call *somefunc'.
>
> The existing code handles them not by virtue of the relocs, as I said,
> but by a simple delta of the old and new location of the instruction.
>
> But it only does so for the *first* instruction of the altinstr, if it
> happens to be a (4-byte?) branch.

Ugh. That's nasty.

Wouldn't it be much better to simply do it as part of relocation instead?

Linus