From: Frediano Ziglio <freddy77@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: "Frediano Ziglio" <frediano.ziglio@cloud.com>,
"Frediano Ziglio" <frediano.ziglio@citrix.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Jan Beulich" <jbeulich@suse.com>
Subject: [PATCH v7 1/4] Align relevant sections to 4KB
Date: Mon, 6 Jul 2026 11:45:54 +0100 [thread overview]
Message-ID: <20260706104557.430097-2-frediano.ziglio@citrix.com> (raw)
In-Reply-To: <20260706104557.430097-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, including the immediately preceding .reloc section, so it's
not an issue if they are not aligned to the page.
Before the .debug sections you could have the .reloc or the SBAT section,
either are permission-compatible.
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v1:
- Change subject.
Changes since v2:
- Improved commit message and subject.
Changes since v3:
- Added Acked-by;
- Improved commit message.
Changes since v4:
- Added missing comment;
- Added Acked-by.
---
xen/arch/x86/xen.lds.S | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..8e63cf5bc2 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,8 @@ SECTIONS
__2M_rwdata_end = ALIGN(SECTION_ALIGN);
#ifdef EFI
+ /* Align to satisfy UEFI CA memory mitigation. */
+ . = ALIGN(PAGE_SIZE);
.reloc ALIGN(4) : {
__base_relocs_start = .;
*(.reloc)
--
2.43.0
next prev parent reply other threads:[~2026-07-06 10:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 10:45 [PATCH v7 0/4] Various patches to improve Secure Boot support Frediano Ziglio
2026-07-06 10:45 ` Frediano Ziglio [this message]
2026-07-06 10:45 ` [PATCH v7 2/4] x86/efi: discard multiboot and PVH support for PE binary Frediano Ziglio
2026-07-08 13:55 ` Jan Beulich
2026-07-14 17:10 ` Marek Marczykowski-Górecki
2026-07-06 10:45 ` [PATCH v7 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot() Frediano Ziglio
2026-07-06 10:45 ` [PATCH v7 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation Frediano Ziglio
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=20260706104557.430097-2-frediano.ziglio@citrix.com \
--to=freddy77@gmail.com \
--cc=frediano.ziglio@citrix.com \
--cc=frediano.ziglio@cloud.com \
--cc=jbeulich@suse.com \
--cc=marmarek@invisiblethingslab.com \
--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.