Arm: avoid .init.data to be marked as executable
authorJan Beulich <jbeulich@suse.com>
Mon, 14 Jun 2021 13:52:36 +0000 (15:52 +0200)
committerJulien Grall <jgrall@amazon.com>
Mon, 14 Jun 2021 16:53:52 +0000 (17:53 +0100)
commit8c9ed863738ff9e8b91975d6aa4464e7e8324eb7
tree648714f635ba7130e3e12309e56dd348a45065f4
parent163f47c14737cfa9dfb3240deea356b08caf7614
Arm: avoid .init.data to be marked as executable

This confuses disassemblers, at the very least. Move
.altinstr_replacement to .init.text. The previously redundant ALIGN()
now gets converted to page alignment, such that the hypervisor mapping
won't have this as executable (it'll instead get mapped r/w, which I'm
told is intended to be adjusted at some point).

Note that for the actual patching logic's purposes this part of
.init.text _has_ to live after _einittext (or before _sinittext), or
else branch_insn_requires_update() would produce wrong results.

Also, to have .altinstr_replacement have consistent attributes in the
object files, add "x" to the one instance where it was missing.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/xen.lds.S
xen/include/asm-arm/alternative.h