From: "tip-bot2 for Hamza Mahfooz" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Jared White <jaredwhite@microsoft.com>,
Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/build] x86/build: Only align ENTRY_TEXT to PMD_SIZE if necessary
Date: Fri, 10 Jul 2026 09:30:09 -0000 [thread overview]
Message-ID: <178367580996.744054.14765868468067968799.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260623152430.1473481-1-hamzamahfooz@linux.microsoft.com>
The following commit has been merged into the x86/build branch of tip:
Commit-ID: f6cff820877ff34839920ff9de9b912359cfb607
Gitweb: https://git.kernel.org/tip/f6cff820877ff34839920ff9de9b912359cfb607
Author: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
AuthorDate: Tue, 23 Jun 2026 11:24:29 -04:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 10 Jul 2026 11:21:17 +02:00
x86/build: Only align ENTRY_TEXT to PMD_SIZE if necessary
PTI requires the begin and end of ENTRY_TEXT be aligned to PMD_SIZE. SRSO
requires srso_alias_untrain_ret to be 2M aligned. This costs between 2-4 MiB
of RAM (depending on the size of the preceding section). So, only align when
either of the two are enabled.
Co-developed-by: Jared White <jaredwhite@microsoft.com>
Signed-off-by: Jared White <jaredwhite@microsoft.com>
Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20260623152430.1473481-1-hamzamahfooz@linux.microsoft.com
---
arch/x86/kernel/vmlinux.lds.S | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 74e336d..10caf92 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -65,9 +65,15 @@ const_cpu_current_top_of_stack = cpu_current_top_of_stack;
__end_rodata_hpage_align = .; \
__end_rodata_aligned = .;
+#if defined(CONFIG_MITIGATION_PAGE_TABLE_ISOLATION) || defined(CONFIG_MITIGATION_SRSO)
#define ALIGN_ENTRY_TEXT_BEGIN . = ALIGN(PMD_SIZE);
#define ALIGN_ENTRY_TEXT_END . = ALIGN(PMD_SIZE);
#else
+#define ALIGN_ENTRY_TEXT_BEGIN
+#define ALIGN_ENTRY_TEXT_END
+#endif
+
+#else
#define X86_ALIGN_RODATA_BEGIN
#define X86_ALIGN_RODATA_END \
prev parent reply other threads:[~2026-07-10 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 15:24 [PATCH v2 1/2] x86/build: only " Hamza Mahfooz
2026-06-23 15:24 ` [PATCH v2 2/2] x86/mm/64: free the gap between BSS_MAIN and BSS_DECRYPTED Hamza Mahfooz
2026-07-09 22:36 ` Borislav Petkov
2026-07-09 23:14 ` [tip: x86/cleanups] x86/build: Only align ENTRY_TEXT to PMD_SIZE if necessary tip-bot2 for Hamza Mahfooz
2026-07-10 9:30 ` tip-bot2 for Hamza Mahfooz [this message]
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=178367580996.744054.14765868468067968799.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=hamzamahfooz@linux.microsoft.com \
--cc=jaredwhite@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®