diff mbox series

[v2,1/5] x86: Put trampoline in .init.data section

Message ID 20240814083428.3012-2-frediano.ziglio@cloud.com (mailing list archive)
State New
Headers show
Series Support EFI multiboot loading using PE binary | expand

Commit Message

Frediano Ziglio Aug. 14, 2024, 8:34 a.m. UTC
This change allows to put the trampoline in a separate, not executable
section. The trampoline contains a mix of code and data (data which
is modified from C code during early start so must be writable).
This is in preparation for W^X patch in order to satisfy UEFI CA
memory mitigation requirements.
At the moment .init.text and .init.data in EFI mode are put together
so they will be in the same final section as before this patch.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494..16830f636f 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -870,6 +870,8 @@  cmdline_parse_early:
 reloc:
         .incbin "reloc.bin"
 
+        .section .init.data, "aw", @progbits
+
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)