summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-10-26 14:01:36 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-10-28 23:25:25 +0200
commit134ab5bd1883312d7a4b3033b05c6b5a1bb8889b (patch)
tree39d11f68c60a068c6d5ed56688e89a3907fe0ad4 /arch
parentc509331b41b7365e17396c246e8c5797bccc8074 (diff)
downloadlinux-stable-134ab5bd1883312d7a4b3033b05c6b5a1bb8889b.tar.gz
linux-stable-134ab5bd1883312d7a4b3033b05c6b5a1bb8889b.tar.bz2
linux-stable-134ab5bd1883312d7a4b3033b05c6b5a1bb8889b.zip
objtool,x86: Replace alternatives with .retpoline_sites
Instead of writing complete alternatives, simply provide a list of all the retpoline thunk calls. Then the kernel is free to do with them as it pleases. Simpler code all-round. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Borislav Petkov <bp@suse.de> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Tested-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/r/20211026120309.850007165@infradead.org
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/vmlinux.lds.S14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index efd9e9ea17f2..3d6dc12d198f 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -272,6 +272,20 @@ SECTIONS
__parainstructions_end = .;
}
+#ifdef CONFIG_RETPOLINE
+ /*
+ * List of instructions that call/jmp/jcc to retpoline thunks
+ * __x86_indirect_thunk_*(). These instructions can be patched along
+ * with alternatives, after which the section can be freed.
+ */
+ . = ALIGN(8);
+ .retpoline_sites : AT(ADDR(.retpoline_sites) - LOAD_OFFSET) {
+ __retpoline_sites = .;
+ *(.retpoline_sites)
+ __retpoline_sites_end = .;
+ }
+#endif
+
/*
* struct alt_inst entries. From the header (alternative.h):
* "Alternative instructions for different CPU types or capabilities"