Re: [PATCH v14 00/22] TDX KVM selftests

2026-10-12 Thread Edgecombe, Rick P
On Sat, 2026-10-10 at 09:28 +0800, Xiaoyao Li wrote:
> > Otherwise, I disagree with the plan to drop the tests for the old interface.
> > That said I'd would be thrilled to have anything upstream, so if the set can
> > be
> > smaller or faster that way, then I agree with the change.
> 
> The v15 actually supports both: out-of-place conversion (per-VM memory
> attributes) and in-place conversion.

Oh, hmm... I'll take a look. Previously the direction was to break it apart into
smaller pieces. So I would have assumed that would have meant supporting only
one in the initial set.

> 
> > But in general, I'd like to know the plan for the old interface.
> 
> Sean talked something about it:
> https://lore.kernel.org/all/[email protected]/




Re: [PATCH v14 00/22] TDX KVM selftests

2026-10-09 Thread Xiaoyao Li
On 10/9/2026 5:16 AM, Edgecombe, Rick P wrote:
> On Mon, 2026-08-17 at 10:58 -0700, Edgecombe, Rick P wrote:
 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.

>>>
>>> We wanted to have this series based on in-place conversion since
>>> non-in-place conversion is on a deprecation path.
>>
>> Hmm, what kind of timeline do you see for the old interface actually getting
>> yanked out of the kernel? I was imagining it would be there for many years at
>> minimum, in which case it would need tests too.
>>
>> The level of dependencies we have on coco stuff is pretty unfortunate I 
>> think.
>> Considering these tests should have ideally quickly followed the TDX base
>> upstreaming, it would be nice if we could avoid it here.
> 
> I saw the new version is also based on in-place conversion (which is now 
> headed
> upstream, congrats!). But can we talk about the legacy deprecation? Is there a
> plan to actually deprecate and remove it, or even move qemu off of the old
> interface?
> 
> Otherwise, I disagree with the plan to drop the tests for the old interface.
> That said I'd would be thrilled to have anything upstream, so if the set can 
> be
> smaller or faster that way, then I agree with the change.

The v15 actually supports both: out-of-place conversion (per-VM memory
attributes) and in-place conversion.

> But in general, I'd like to know the plan for the old interface.

Sean talked something about it:
https://lore.kernel.org/all/[email protected]/



Re: [PATCH v14 00/22] TDX KVM selftests

2026-10-08 Thread Edgecombe, Rick P
On Mon, 2026-08-17 at 10:58 -0700, Edgecombe, Rick P wrote:
> > > 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.
> > > 
> > 
> > We wanted to have this series based on in-place conversion since
> > non-in-place conversion is on a deprecation path.
> 
> Hmm, what kind of timeline do you see for the old interface actually getting
> yanked out of the kernel? I was imagining it would be there for many years at
> minimum, in which case it would need tests too.
> 
> The level of dependencies we have on coco stuff is pretty unfortunate I think.
> Considering these tests should have ideally quickly followed the TDX base
> upstreaming, it would be nice if we could avoid it here.

I saw the new version is also based on in-place conversion (which is now headed
upstream, congrats!). But can we talk about the legacy deprecation? Is there a
plan to actually deprecate and remove it, or even move qemu off of the old
interface?

Otherwise, I disagree with the plan to drop the tests for the old interface.
That said I'd would be thrilled to have anything upstream, so if the set can be
smaller or faster that way, then I agree with the change.

But in general, I'd like to know the plan for the old interface.


Re: [PATCH v14 00/22] TDX KVM selftests

2026-08-28 Thread Lisa Wang
On Thu, Aug 13, 2026 at 11:05:17PM +, Edgecombe, Rick P wrote:
> --- 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);
>
Thanks for testing this! The patch series posted here on the mailing
list is correct, but I made the mistake when pushing the code to the
branch.

I have just force-pushed the fix to the branch. It should compile
correctly now. Could you please pull the latest version and give it
another try?

Lisa



Re: [PATCH v14 00/22] TDX KVM selftests

2026-08-17 Thread Edgecombe, Rick P
On Sun, 2026-08-16 at 21:19 -0700, Ackerley Tng wrote:
> "Edgecombe, Rick P"  writes:
> 
> > On Thu, 2026-08-13 at 15:47 -0700, Rick Edgecombe wrote:
> > > On Wed, 2026-07-22 at 23:13 +, 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.
> > 
> 
> We wanted to have this series based on in-place conversion since
> non-in-place conversion is on a deprecation path.

Hmm, what kind of timeline do you see for the old interface actually getting
yanked out of the kernel? I was imagining it would be there for many years at
minimum, in which case it would need tests too.

The level of dependencies we have on coco stuff is pretty unfortunate I think.
Considering these tests should have ideally quickly followed the TDX base
upstreaming, it would be nice if we could avoid it here.

>  Also, it makes the set up easier :)

Hmm, yea maybe. I'm just wishing to unblock this finally. And so it seems like
adding new roadblocks.

> 
> At this point I don't think this series is going to make it for 7.3, so
> at best it makes it for 7.4 (together with in-place conversion), which I
> think works out?
> 
> Sean, let us know what you think about scheduling. We can rebase without
> in-place conversion if necessary.
> 
> > 
> > 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 

Re: [PATCH v14 00/22] TDX KVM selftests

2026-08-16 Thread Ackerley Tng
"Edgecombe, Rick P"  writes:

> On Thu, 2026-08-13 at 15:47 -0700, Rick Edgecombe wrote:
>> On Wed, 2026-07-22 at 23:13 +, 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.
>

We wanted to have this series based on in-place conversion since
non-in-place conversion is on a deprecation path. Also, it makes the set
up easier :)

At this point I don't think this series is going to make it for 7.3, so
at best it makes it for 7.4 (together with in-place conversion), which I
think works out?

Sean, let us know what you think about scheduling. We can rebase without
in-place conversion if necessary.

>
> 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 
>  #include 
>  #include 
> -#include 
> +#include 

I recall a similar fix [1] you posted, I think both Lisa and I are
relying on some LSP auto-including, we'll adopt . Let me
know you know a good way to configure the auto-includes.

[1] 
https://lore.kernel.org/all/[email protected]/

What compiler/version are you using? We'd like to reproduce.

>  #include 
>  #include 
>
> diff --git a/tools/testing/selftests/kvm/lib/x86/tdx/td_boot_offsets.c
> 

Re: [PATCH v14 00/22] TDX KVM selftests

2026-08-13 Thread Edgecombe, Rick P
On Thu, 2026-08-13 at 15:47 -0700, Rick Edgecombe wrote:
> On Wed, 2026-07-22 at 23:13 +, 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 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
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);



Re: [PATCH v14 00/22] TDX KVM selftests

2026-08-13 Thread Edgecombe, Rick P
On Wed, 2026-07-22 at 23:13 +, 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.