[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251013143444.3999-25-david.kaplan@amd.com>
Date: Mon, 13 Oct 2025 09:34:12 -0500
From: David Kaplan <david.kaplan@....com>
To: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>, Ingo Molnar
<mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
<x86@...nel.org>, "H . Peter Anvin" <hpa@...or.com>
CC: Alexander Graf <graf@...zon.com>, Boris Ostrovsky
<boris.ostrovsky@...cle.com>, <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH 24/56] x86/vmlinux.lds: Move altinstr_aux conditionally
The altinstr_aux section contains code that must remain when dynamic
mitigations are supported. Move it into the normal .text section so it is
not free'd when init memory is free'd.
Signed-off-by: David Kaplan <david.kaplan@....com>
---
arch/x86/kernel/vmlinux.lds.S | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index e0db3f4c97df..c4a0bb13d095 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -143,6 +143,9 @@ SECTIONS
*/
. = srso_alias_untrain_ret | (1 << 2) | (1 << 8) | (1 << 14) | (1 << 20);
*(.text..__x86.rethunk_safe)
+#endif
+#ifdef CONFIG_DYNAMIC_MITIGATIONS
+ *(.altinstr_aux)
#endif
ALIGN_ENTRY_TEXT_END
@@ -262,6 +265,7 @@ SECTIONS
INIT_TEXT_SECTION(PAGE_SIZE)
+#ifndef CONFIG_DYNAMIC_MITIGATIONS
/*
* Section for code used exclusively before alternatives are run. All
* references to such code must be patched out by alternatives, normally
@@ -272,8 +276,9 @@ SECTIONS
.altinstr_aux : AT(ADDR(.altinstr_aux) - LOAD_OFFSET) {
*(.altinstr_aux)
. = ALIGN(PAGE_SIZE);
- __inittext_end = .;
}
+#endif
+ __inittext_end = .;
INIT_DATA_SECTION(16)
--
2.34.1
Powered by blists - more mailing lists