On Thu, 2026-08-13 at 15:47 -0700, Rick Edgecombe wrote:
> On Wed, 2026-07-22 at 23:13 +0000, Lisa Wang wrote:
> > v14 revision for TDX KVM selftests based on kvm/next and guest_memfd:
> > In-place conversion support[1]. This series needs some changes from
> > in-place conversion v9. For ease of testing, an extra hack commit has
> > been added. The complete code is available at:
> > https://github.com/googleprodkernel/linux-cc/commits/tdx-selftests-v14
> 
> Are you able to get sashiko review on this? Or did you internally somehow? It
> seems the public sashiko cannot figure out this stack.

Actually why is this on top of in-place conversion? I thought the idea was to
break the series apart to get something basic upstream:
https://lore.kernel.org/all/[email protected]/

Adding in-place conversion tests seems to be going in the opposite direction.


Also, the branch does not build for me:
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:26:
undefined reference to `TD_BOOT_PARAMETERS_PER_VCPU'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:30:
undefined reference to `TD_PER_VCPU_PARAMETERS_ESP_GVA'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:33:
undefined reference to `TD_BOOT_PARAMETERS_GDT'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:37:
undefined reference to `TD_BOOT_PARAMETERS_IDT'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:44:
undefined reference to `TD_BOOT_PARAMETERS_CR4'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:46:
undefined reference to `TD_BOOT_PARAMETERS_CR3'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:48:
undefined reference to `TD_BOOT_PARAMETERS_CR0'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:54:
undefined reference to `TD_PER_VCPU_PARAMETERS_GUEST_CODE'
collect2: error: ld returned 1 exit status
make: *** [Makefile.kvm:351:
.../linux/tools/testing/selftests/kvm/demand_paging_test] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.o: in
function `td_boot':
.../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:24: undefined
reference to `SIZEOF_TD_PER_VCPU_PARAMETERS'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:26:
undefined reference to `TD_BOOT_PARAMETERS_PER_VCPU'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:30:
undefined reference to `TD_PER_VCPU_PARAMETERS_ESP_GVA'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:33:
undefined reference to `TD_BOOT_PARAMETERS_GDT'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:37:
undefined reference to `TD_BOOT_PARAMETERS_IDT'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:44:
undefined reference to `TD_BOOT_PARAMETERS_CR4'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:46:
undefined reference to `TD_BOOT_PARAMETERS_CR3'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:48:
undefined reference to `TD_BOOT_PARAMETERS_CR0'
/usr/bin/ld: .../linux/tools/testing/selftests/kvm/lib/x86/tdx/td_boot.S:54:
undefined reference to `TD_PER_VCPU_PARAMETERS_GUEST_CODE'
collect2: error: ld returned 1 exit status
make: *** [Makefile.kvm:351:
.../linux/tools/testing/selftests/kvm/dirty_log_test] Error 1

If I apply these patches on 8cf3969a0b7d4 from the branch, it builds though. It
looks like a few changes are missing from the branch:

diff --git a/tools/testing/selftests/kvm/guest_memfd_test.c
b/tools/testing/selftests/kvm/guest_memfd_test.c
index d6528c6f5e031..b099b09cbae3d 100644
--- a/tools/testing/selftests/kvm/guest_memfd_test.c
+++ b/tools/testing/selftests/kvm/guest_memfd_test.c
@@ -14,7 +14,7 @@
 #include <linux/bitmap.h>
 #include <linux/falloc.h>
 #include <linux/sizes.h>
-#include <sys/mman.h>
+#include <linux/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
diff --git a/tools/testing/selftests/kvm/lib/x86/tdx/td_boot_offsets.c
b/tools/testing/selftests/kvm/lib/x86/tdx/td_boot_offsets.c
index b81cd16198ecf..7f76a3585b99a 100644
--- a/tools/testing/selftests/kvm/lib/x86/tdx/td_boot_offsets.c
+++ b/tools/testing/selftests/kvm/lib/x86/tdx/td_boot_offsets.c
@@ -5,7 +5,7 @@
 
 #include "tdx/td_boot.h"
 
-static void __used common(void)
+static void __attribute__((used)) common(void)
 {
        OFFSET(TD_BOOT_PARAMETERS_CR0, td_boot_parameters, cr0);
        OFFSET(TD_BOOT_PARAMETERS_CR3, td_boot_parameters, cr3);

Reply via email to