[GIT PULL] x86 fix
From: Ingo Molnar
Date: Tue Jan 28 2025 - 17:20:06 EST
* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, 27 Jan 2025 at 07:54, Ingo Molnar <mingo@xxxxxxxxxx> wrote:
> >
> > Fix a build regression on certain config and build environment
> > combinations that generate absolute references to symbols.
>
> I'll hold off on this, because it looks like Ard is very close to
> have this fixed (and also made it non-fatal in the process).
Makes sense - meanwhile while Ard is iterating his build-warning patch
here's the SEV fix that should address the build failure you've
reported.
Please pull the latest x86/urgent Git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2025-01-28
# HEAD: 1105ab42a84bc11c62597005f78ccad2434fbd66 x86/sev: Disable jump tables in SEV startup code
Fix a build regression on certain config and build environment
combinations that generate absolute references to symbols.
Thanks,
Ingo
------------------>
Ard Biesheuvel (1):
x86/sev: Disable jump tables in SEV startup code
arch/x86/coco/sev/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/coco/sev/Makefile b/arch/x86/coco/sev/Makefile
index 08de37559307..dcb06dc8b5ae 100644
--- a/arch/x86/coco/sev/Makefile
+++ b/arch/x86/coco/sev/Makefile
@@ -2,6 +2,10 @@
obj-y += core.o
+# jump tables are emitted using absolute references in non-PIC code
+# so they cannot be used in the early SEV startup code
+CFLAGS_core.o += -fno-jump-tables
+
ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_core.o = -pg
endif