Re: [PATCH 4/5] x86/alternatives: Add an auxilary section

From: H. Peter Anvin
Date: Thu Jan 21 2016 - 14:11:13 EST

On 01/21/16 11:07, Borislav Petkov wrote:
> On Thu, Jan 21, 2016 at 11:00:03AM -0800, H. Peter Anvin wrote:
>> NAK on this being part of .altinstr_replacement (if anything it ought to
>> simply be part of .text.init). Otherwise fine.
> You mean .init.text. Brian had it there in his original version. Out of
> curiosity, why don't you want it in .altinstr_replacement? To avoid any
> mixup?

We covered that already:

.altinstr_replacement doesn't need to be +X (and shouldn't be, but
that's another patch.)

.altinstr_replacement is also "special" in that all the instructions are
offset and not run in place. These are just plain code stubs and are
executed in place, as is. The only reason to have a special section for
these at all is to avoid the "init code referenced from non-init-code"