[PATCH v4 2/3] x86: Split output sections for UEFI CA memory mitigation requirements

Frediano Ziglio posted 3 patches 1 year, 1 month ago
[PATCH v4 2/3] x86: Split output sections for UEFI CA memory mitigation requirements
Posted by Frediano Ziglio 1 year, 1 month ago
Split code and data to satisfy W^X requirement.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/xen.lds.S | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 22fb7d8458..b0b952dd9c 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -194,11 +194,7 @@ SECTIONS
   __2M_init_start = .;         /* Start of 2M superpages, mapped RWX (boot only). */
   . = ALIGN(PAGE_SIZE);             /* Init code and data */
   __init_begin = .;
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-  DECL_SECTION(.init) {
-#else
   DECL_SECTION(.init.text) {
-#endif
        _sinittext = .;
        *(.init.text)
        *(.text.startup)
@@ -210,12 +206,9 @@ SECTIONS
         */
        *(.altinstr_replacement)
 
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-       . = ALIGN(SMP_CACHE_BYTES);
-#else
   } PHDR(text)
+
   DECL_SECTION(.init.data) {
-#endif
        *(.init.bss.stack_aligned)
 
        . = ALIGN(POINTER_ALIGN);
-- 
2.34.1
Re: [PATCH v4 2/3] x86: Split output sections for UEFI CA memory mitigation requirements
Posted by Jan Beulich 1 year, 1 month ago
On 19.09.2024 10:00, Frediano Ziglio wrote:
> Split code and data to satisfy W^X requirement.
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
as long as it goes on top of the long section names enabling patch.

Jan