[PATCH] [STABLE] 6.12.23: arch/x86/coco/tdx/tdx.c build error
From: Cal Peake
Date: Sat Apr 12 2025 - 16:53:46 EST
Hi,
6.12.23 fails to build for me with the error:
CC arch/x86/coco/tdx/tdx.o
arch/x86/coco/tdx/tdx.c: In function ʽtdx_early_initʼ:
arch/x86/coco/tdx/tdx.c:1080:19: error: ʽstruct pv_irq_opsʼ has no member named ʽsafe_haltʼ
1080 | pv_ops.irq.safe_halt = tdx_safe_halt;
| ^
arch/x86/coco/tdx/tdx.c:1081:19: error: ʽstruct pv_irq_opsʼ has no member named ʽhaltʼ
1081 | pv_ops.irq.halt = tdx_halt;
| ^
make[5]: *** [scripts/Makefile.build:229: arch/x86/coco/tdx/tdx.o] Error 1
make[4]: *** [scripts/Makefile.build:478: arch/x86/coco/tdx] Error 2
make[3]: *** [scripts/Makefile.build:478: arch/x86/coco] Error 2
make[2]: *** [scripts/Makefile.build:478: arch/x86] Error 2
make[1]: *** [/home/cal/tmp/volatile/linux-6.12.23/Makefile:1944: .] Error 2
make: *** [Makefile:224: __sub-make] Error 2
Those struct members are only available when CONFIG_PARAVIRT_XXL is
defined.
The below patch adds a check for that macro and gets the build to
completion.
My config is attached for reference.
--
Cal Peake
Signed-off-by: Cal Peake <cp@xxxxxxxxxxxxxxxxxxx>
--- ./arch/x86/coco/tdx/tdx.c 2025-04-10 08:39:41.000000000 -0400
+++ ./arch/x86/coco/tdx/tdx.c 2025-04-12 15:42:35.275284746 -0400
@@ -1066,7 +1066,7 @@
x86_platform.guest.enc_kexec_begin = tdx_kexec_begin;
x86_platform.guest.enc_kexec_finish = tdx_kexec_finish;
-
+#ifdef CONFIG_PARAVIRT_XXL
/*
* Avoid "sti;hlt" execution in TDX guests as HLT induces a #VE that
* will enable interrupts before HLT TDCALL invocation if executed
@@ -1079,7 +1079,7 @@
*/
pv_ops.irq.safe_halt = tdx_safe_halt;
pv_ops.irq.halt = tdx_halt;
-
+#endif
/*
* TDX intercepts the RDMSR to read the X2APIC ID in the parallel
* bringup low level code. That raises #VE which cannot be handledAttachment:
config-6.12.23.gz
Description: config-6.12.23.gz