xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Arm: avoid .init.data to be marked as executable
@ 2021-06-11  9:39 Jan Beulich
  2021-06-14  9:41 ` Julien Grall
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2021-06-11  9:39 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, Stefano Stabellini

This confuses disassemblers, at the very least. Move
.altinstr_replacement to .init.text, dropping the redundant ALIGN().

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>
---
I'm uncertain whether having .altinstr_replacement inside or outside the
[_sinittext,_einittext) region is better; I simply followed what we have
on the x86 side right now.

--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -147,6 +147,7 @@ SECTIONS
   .init.text : {
        _sinittext = .;
        *(.init.text)
+       *(.altinstr_replacement)
        _einittext = .;
   } :text
   . = ALIGN(PAGE_SIZE);
@@ -169,8 +170,6 @@ SECTIONS
        __alt_instructions = .;
        *(.altinstructions)
        __alt_instructions_end = .;
-       . = ALIGN(4);
-       *(.altinstr_replacement)
 
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
        . = ALIGN(POINTER_ALIGN);
--- a/xen/include/asm-arm/alternative.h
+++ b/xen/include/asm-arm/alternative.h
@@ -67,7 +67,7 @@ int apply_alternatives(const struct alt_
 	ALTINSTR_ENTRY(feature,cb)					\
 	".popsection\n"							\
 	" .if " __stringify(cb) " == 0\n"				\
-	".pushsection .altinstr_replacement, \"a\"\n"			\
+	".pushsection .altinstr_replacement, \"ax\"\n"			\
 	"663:\n\t"							\
 	newinstr "\n"							\
 	"664:\n\t"							\



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-14 12:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11  9:39 [PATCH] Arm: avoid .init.data to be marked as executable Jan Beulich
2021-06-14  9:41 ` Julien Grall
2021-06-14 10:02   ` Jan Beulich
2021-06-14 10:32     ` Julien Grall
2021-06-14 12:17       ` Jan Beulich
2021-06-14 12:56         ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).