Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.
This repository was archived by the owner on Oct 29, 2025. It is now read-only.

Compile TDX Kernel Error #2

@DiWangShePi

Description

@DiWangShePi

I'm compiling the kernel for the TDX VM and server based on the instructions from this repository. The kernel I used is:

https://github.com/torvalds/linux/tree/v6.6-rc2

After obtaining the complete files, I used the patch files in this repository to patch the kernel:

for patchfile in ~/tdx-linux/kernel-patch/kernel_patch-breakdown/*.patch; do
    patch -p1 < "$patchfile"
done

Subsequently, I tried to generate a .config file, but due to the lack of relevant instructions in this repository, I referred to the configuration files in branch tdx-1.0 and tdx-1.5 under this repository:

https://github.com/intel/tdx-tools

After that, I used the make -j$(getconf _NPROCESSORS_ONLN) LOCALVERSION="-tdx" deb-pkg command and encountered the following error:

make[5]: *** [Makefile:1913:.] error 2
make[4]: *** [Makefile:359:__build_one_by_one] error 2
make[3]: *** [debian/rules:25:build-arch] error 2
dpkg-buildpackage: error: make -f debian/rules binary subprocess returned exit status 2
make[2]: *** [scripts/Makefile.package:146:deb-pkg] error 2
make[1]: *** [/home/gulu/Desktop/Intel-TDX/linux-6.6-rc2/Makefile:1538:deb-pkg] error 2
make: *** [Makefile:234:__sub-make] error 2

Which seems to indicates that error occurs while executing command make -f debian/rules, so I execute this command in the same location, and got the following result:

arch/x86/hyperv/ivm.c:387:16: error: variable ‘args’ has initializer but incomplete type
  387 |         struct tdx_hypercall_args args = {
      |                ^~~~~~~~~~~~~~~~~~
arch/x86/hyperv/ivm.c:388:18: error: ‘struct tdx_hypercall_args’ has no member named ‘r10’
  388 |                 .r10 = TDX_HYPERCALL_STANDARD,
      |                  ^~~
...
arch/x86/hyperv/ivm.c:389:18: error: ‘struct tdx_hypercall_args’ has no member named ‘r11’
  389 |                 .r11 = EXIT_REASON_MSR_WRITE,
      |   
...
arch/x86/hyperv/ivm.c:390:18: error: ‘struct tdx_hypercall_args’ has no member named ‘r12’
  390 |                 .r12 = msr,
      |                  ^~~
arch/x86/hyperv/ivm.c:390:24: warning: excess elements in struct initializer
  390 |                 .r12 = msr,
      |                        ^~~
arch/x86/hyperv/ivm.c:390:24: note: (near initialization for ‘args’)
arch/x86/hyperv/ivm.c:391:18: error: ‘struct tdx_hypercall_args’ has no member named ‘r13’
  391 |                 .r13 = val,
      |                  ^~~
arch/x86/hyperv/ivm.c:391:24: warning: excess elements in struct initializer
  391 |                 .r13 = val,
      |                        ^~~
arch/x86/hyperv/ivm.c:391:24: note: (near initialization for ‘args’)
arch/x86/hyperv/ivm.c:387:35: error: storage size of ‘args’ isn’t known
  387 |         struct tdx_hypercall_args args = {
      |                                   ^~~~
arch/x86/hyperv/ivm.c:387:35: warning: unused variable ‘args’ [-Wunused-variable]
arch/x86/hyperv/ivm.c: In function ‘hv_tdx_msr_read’:
arch/x86/hyperv/ivm.c:401:16: error: variable ‘args’ has initializer but incomplete type
  401 |         struct tdx_hypercall_args args = {
      |                ^~~~~~~~~~~~~~~~~~
arch/x86/hyperv/ivm.c:402:18: error: ‘struct tdx_hypercall_args’ has no member named ‘r10’
  402 |                 .r10 = TDX_HYPERCALL_STANDARD,
      |                  ^~~

It looks like this has to do with the implementation of the TDX part, I'm not quite sure if I'm missing a patch or have the wrong environment configured(Ubuntu 22.04). I have no problem compiling TDVF and QEMU following the instructions in the wiki section of this repository.
Would appreciate any help 🙏🙏🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions