[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251013143444.3999-26-david.kaplan@amd.com>
Date: Mon, 13 Oct 2025 09:34:13 -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 25/56] x86/vmlinux.lds: Define __init_alt_end
With the alternative related information at the beginning of the .init
section, __init_alt_end defines the end of the alternative sections. The
memory from __init_begin to __init_alt_end must stick around to support
re-patching.
Signed-off-by: David Kaplan <david.kaplan@....com>
---
arch/x86/kernel/vmlinux.lds.S | 5 +++++
arch/x86/tools/relocs.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index c4a0bb13d095..e02044da9971 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -262,6 +262,11 @@ SECTIONS
*(.altinstr_replacement)
}
+ /* Everything from here until __init_end is always freed */
+ . = ALIGN(PAGE_SIZE);
+ .init.alt.end : AT(ADDR(.init.alt.end) - LOAD_OFFSET) {
+ __init_alt_end = .;
+ }
INIT_TEXT_SECTION(PAGE_SIZE)
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index e5a2b9a912d1..2054ffbf5fd4 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -71,6 +71,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
*/
[S_REL] =
"^(__init_(begin|end)|"
+ "__init_alt_end|"
"__x86_cpu_dev_(start|end)|"
"__alt_instructions(_end)?|"
"(__iommu_table|__apicdrivers|__smp_locks)(_end)?|"
--
2.34.1
Powered by blists - more mailing lists