All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frediano Ziglio <freddy77@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: "Frediano Ziglio" <frediano.ziglio@cloud.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Frediano Ziglio" <frediano.ziglio@citrix.com>
Subject: [PATCH v3 1/4] Align relevant sections to 4KB
Date: Tue, 16 Jun 2026 11:13:33 +0100	[thread overview]
Message-ID: <20260616101336.44009-2-frediano.ziglio@citrix.com> (raw)
In-Reply-To: <20260616101336.44009-1-frediano.ziglio@citrix.com>

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Required by UEFI CA memory mitigation.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Sections with different permissions must be in separate pages.
In the case of debug sections they are contiguous and have the same
permissions so it's not an issue if they are not aligned to the page.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
--
Changes since v1:
- Change subject.

Changes since v2:
- Improved commit message and subject.
---
 xen/arch/x86/xen.lds.S | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..f758940674 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -162,8 +162,8 @@ SECTIONS
        __note_gnu_build_id_end = .;
   } PHDR(note) PHDR(text)
 #elif defined(BUILD_ID_EFI)
-  /* Workaround bug in binutils < 2.36 */
-  . = ALIGN(32);
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   DECL_SECTION(.buildid) {
        __note_gnu_build_id_start = .;
        *(.buildid)
@@ -330,6 +330,7 @@ SECTIONS
   __2M_rwdata_end = ALIGN(SECTION_ALIGN);
 
 #ifdef EFI
+  . = ALIGN(PAGE_SIZE);
   .reloc ALIGN(4) : {
     __base_relocs_start = .;
     *(.reloc)
-- 
2.43.0



  reply	other threads:[~2026-06-16 10:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 10:13 [PATCH v3 0/4] Various patches to improve Secure Boot support Frediano Ziglio
2026-06-16 10:13 ` Frediano Ziglio [this message]
2026-06-16 10:44   ` [PATCH v3 1/4] Align relevant sections to 4KB Marek Marczykowski-Górecki
2026-06-16 12:27   ` Jan Beulich
2026-06-16 14:38     ` Frediano Ziglio
2026-06-16 14:54       ` Marek Marczykowski-Górecki
2026-06-16 10:13 ` [PATCH v3 2/4] x86/efi: discard multiboot support for PE binary Frediano Ziglio
2026-06-16 10:55   ` Marek Marczykowski-Górecki
2026-06-16 10:13 ` [PATCH v3 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Frediano Ziglio
2026-06-16 11:04   ` Marek Marczykowski-Górecki
2026-06-16 10:13 ` [PATCH v3 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation Frediano Ziglio
2026-06-16 11:20   ` Marek Marczykowski-Górecki
2026-06-16 11:29     ` Andrew Cooper
2026-06-16 12:30       ` Jan Beulich
2026-06-16 12:40         ` Andrew Cooper
2026-06-16 13:50           ` Frediano Ziglio
2026-06-16 13:50           ` Jan Beulich
2026-06-16 14:46             ` Andrew Cooper
2026-06-16 14:58     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260616101336.44009-2-frediano.ziglio@citrix.com \
    --to=freddy77@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=frediano.ziglio@citrix.com \
    --cc=frediano.ziglio@cloud.com \
    --cc=jbeulich@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=roger.pau@citrix.com \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.