when host consumes a TD
private memory
KVM: selftests: TDX: Add shared memory test
Sagi Shahar (11):
KVM: selftests: TDX: Add report_fatal_error test
KVM: selftests: TDX: Add basic TDX CPUID test
KVM: selftests: TDX: Add basic get_td_vmcall_info test
KVM: selftests: TDX: Add TDX IO w
From: Ackerley Tng
This allows initializing sregs without setting vCPU registers in
KVM.
No functional change intended.
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/include/x86_64/processor.h | 2 +
.../selftests/kvm/lib/x86_64
sible later to be passed to the boot code for rsp
initialization.
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
tools/testing/selftests/kvm/include/kvm_util_base.h | 1 +
tools/testing/selftests/kvm/lib/x86_64/processor.c | 4 +++-
2 files chang
-off-by: Sagi Shahar
---
.../selftests/kvm/include/kvm_util_base.h | 2 +
tools/testing/selftests/kvm/lib/kvm_util.c| 63 ---
2 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h
b/tools/testing/selftests/kvm
ister state cannot be manipulated directly by
setting the VM's memory, hence boot code is provided at the TD's reset
vector. This boot code takes boot parameters loaded in the TD's memory
and sets up the TD for the selftest.
Signed-off-by: Erdem Aktas
Signed-off-by: Ryan Afranji
is used after
vm_init_descriptor_tables().
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/include/x86_64/processor.h | 2 ++
.../selftests/kvm/lib/x86_64/processor.c | 19 ---
2 files changed, 18 insertions(+)
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/lib/x86_64/tdx/tdx_util.c | 41 +++
1 file changed, 32 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util.c
b/tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util.c
index 6b995c3f6153
From: Ackerley Tng
This also exercises the KVM_TDX_CAPABILITIES ioctl.
Suggested-by: Isaku Yamahata
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/lib/x86_64/tdx/tdx_util.c | 69 ++-
1 file changed, 66 insertions
From: Erdem Aktas
Adding a test to verify TDX lifecycle by creating a TD and running a
dummy TDG.VP.VMCALL inside it.
Signed-off-by: Erdem Aktas
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
Co-developed-by: Ackerley Tng
Signed-off-by: Ackerley Tng
---
tools/testing/selftests
The test checks report_fatal_error functionality.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 6 ++-
.../kvm/include/x86_64/tdx/tdx_util.h | 1 +
.../kvm/include/x86_64/tdx/test_util.h
From: Erdem Aktas
Verifies TDVMCALL READ and WRITE operations.
Signed-off-by: Erdem Aktas
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../kvm/include/x86_64/tdx/test_util.h| 34
.../selftests/kvm/x86_64/tdx_vm_tests.c | 82
The test reads CPUID values from inside a TD VM and compare them
to expected values.
The test targets CPUID values which are virtualized as "As Configured",
"As Configured (if Native)", "Calculated", "Fixed" and "Native"
according to the TD
The test calls get_td_vmcall_info from the guest and verifies the
expected returned values.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 3 +
.../kvm/include/x86_64/tdx/test_util.h| 27
The test verifies IO writes of various sizes from the guest to the host.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdcall.h | 3 +
.../selftests/kvm/x86_64/tdx_vm_tests.c | 91 +++
2 files
The test verifies IO reads of various sizes from the host to the guest.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/x86_64/tdx_vm_tests.c | 87 +++
1 file changed, 87 insertions(+)
diff --git a/tools/testing
The test verifies reads and writes for MSR registers with different access
level.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 5 +
.../selftests/kvm/lib/x86_64/tdx/tdx.c| 27
The test verifies that the guest runs TDVMCALL and the
guest vCPU enters to the halted state.
Signed-off-by: Erdem Aktas
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 2 +
.../selftests/kvm/lib/x86_64
The test verifies MMIO reads of various sizes from the host to the guest.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdcall.h | 2 +
.../selftests/kvm/include/x86_64/tdx/tdx.h| 3 +
.../kvm/include/x86_64
This test issues a CPUID TDVMCALL from inside the guest to get the CPUID
values as seen by KVM.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 4 +
.../selftests/kvm/lib/x86_64/tdx/tdx.c| 26
The test verifies MMIO writes of various sizes from the guest to the host.
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 2 +
.../selftests/kvm/lib/x86_64/tdx/tdx.c| 14 +++
.../selftests/kvm
From: Roger Wang
Adds a test for TDG.VP.INFO
Signed-off-by: Roger Wang
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
---
.../selftests/kvm/include/x86_64/tdx/tdcall.h | 19 +++
.../selftests/kvm/include/x86_64/tdx/tdx.h| 5 +
.../selftests/kvm
From: Ackerley Tng
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/include/kvm_util_base.h | 24 ++
tools/testing/selftests/kvm/lib/kvm_util.c| 32 +++
.../selftests/kvm/lib/x86_64/processor.c
From: Ryan Afranji
The test checks that host can only read fixed values when trying to
access the guest's private memory.
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
---
.../selftests/kvm/x86_64/tdx_vm_tests.c | 85 +++
1
From: Ryan Afranji
Adds a test that sets up shared memory between the host and guest.
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
Signed-off-by: Ackerley Tng
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/include/x86_64/tdx/tdx.h| 2 +
.../kvm
From: Ackerley Tng
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/include/x86_64/tdx/tdx.h| 21 +++
.../selftests/kvm/lib/x86_64/tdx/tdx.c| 19 +
2 files changed, 40 insertions(+)
diff
From: Ackerley Tng
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
tools/testing/selftests/kvm/include/x86_64/tdx/tdx.h | 2 ++
tools/testing/selftests/kvm/lib/x86_64/tdx/tdx.c | 5 +
2 files changed, 7 insertions(+)
diff --git a/tools/testing
From: Ackerley Tng
This tests the use of guest memory with explicit MapGPA calls.
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/x86_64/tdx_upm_test.c | 401
From: Ackerley Tng
vm_vaddr_alloc always allocates memory in memslot 0. This allows users
of this function to choose which memslot to allocate virtual memory
in.
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
tools/testing/selftests/kvm/include
ays be set to EFAULT
or EHWPOISON when KVM exits with KVM_EXIT_MEMORY_FAULT, userspace should assume
kvm_run.exit_reason is stale/undefined for all other error numbers.
Signed-off-by: Sagi Shahar
---
tools/testing/selftests/kvm/lib/kvm_util.c | 4
1 file changed, 4 insertions(+)
diff --git a/tool
From: Ackerley Tng
This tests the use of guest memory without explicit MapGPA calls.
Signed-off-by: Ackerley Tng
Signed-off-by: Ryan Afranji
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/x86_64/tdx_upm_test.c | 86 +--
1 file changed, 77 insertions(+), 9 deletions
On Thu, Jun 20, 2024 at 9:51 PM Edgecombe, Rick P
wrote:
>
> +Yan
>
> On Wed, 2024-06-05 at 14:44 -0700, Rick Edgecombe wrote:
> > > I will take a look at rebasing the selftests on top of the Intel
> > > development branch and I can post it on our github branch. We can talk
> > > about co-developm
On Tue, Feb 20, 2024 at 7:43 PM Binbin Wu wrote:
>
>
>
> On 12/13/2023 4:46 AM, Sagi Shahar wrote:
> > From: Ackerley Tng
> >
> > One-to-one GVA to GPA mappings can be used in the guest to set up boot
> > sequences during which paging is enabled, hence r
On Thu, Mar 21, 2024 at 5:29 PM Zhang, Dongsheng X
wrote:
>
>
>
> On 12/12/2023 12:46 PM, Sagi Shahar wrote:
> > From: Ackerley Tng
> >
> > One-to-one GVA to GPA mappings can be used in the guest to set up boot
> > sequences during which paging is enabled, h
On Tue, Feb 20, 2024 at 11:43 PM Binbin Wu wrote:
>
>
>
> On 12/13/2023 4:46 AM, Sagi Shahar wrote:
> > From: Ackerley Tng
> >
> > Split the vCPU descriptor table initialization process into a few
> > steps and expose them:
> >
> > + Setting up t
On Fri, Mar 22, 2024 at 4:33 PM Chen, Zide wrote:
>
>
>
> On 12/12/2023 12:46 PM, Sagi Shahar wrote:
> > From: Erdem Aktas
> >
> > Adding a test to verify TDX lifecycle by creating a TD and running a
> > dummy TDG.VP.VMCALL inside it.
> >
> > Sig
On Fri, Mar 1, 2024 at 12:52 AM Binbin Wu wrote:
>
>
>
> On 12/13/2023 4:46 AM, Sagi Shahar wrote:
> > The test checks report_fatal_error functionality.
> >
> > Signed-off-by: Sagi Shahar
> > Signed-off-by: Ackerley Tng
> > Signed-off-by: Ryan Afranj
On Sun, Mar 3, 2024 at 8:49 PM Yan Zhao wrote:
>
> On Tue, Dec 12, 2023 at 12:46:25PM -0800, Sagi Shahar wrote:
> > From: Erdem Aktas
> >
> > Verifies TDVMCALL READ and WRITE operations.
> >
> > Signed-off-by: Erdem Aktas
> > Signed-off-by: Sa
On Tue, Mar 5, 2024 at 12:10 AM Yan Zhao wrote:
>
> On Sat, Mar 02, 2024 at 03:31:07PM +0800, Binbin Wu wrote:
> > On 12/13/2023 4:46 AM, Sagi Shahar wrote:
> > > The test verifies that the guest runs TDVMCALL and the
> > > guest vCPU enters to the halted state.
&g
On Tue, Mar 5, 2024 at 3:28 AM Yan Zhao wrote:
>
> On Tue, Dec 12, 2023 at 12:46:33PM -0800, Sagi Shahar wrote:
> > The test verifies MMIO writes of various sizes from the guest to the host.
> >
> > Signed-off-by: Sagi Shahar
> > Signed-off-by: Ackerley Tng
&
On Wed, Jun 5, 2024 at 1:38 PM Verma, Vishal L wrote:
>
> On Tue, 2023-12-12 at 12:46 -0800, Sagi Shahar wrote:
> > Hello,
> >
> > This is v4 of the patch series for TDX selftests.
> >
> > It has been updated for Intel’s v17 of the TDX host patches wh
On Wed, Jun 5, 2024 at 3:18 PM Verma, Vishal L wrote:
>
> On Wed, 2024-06-05 at 20:15 +, Verma, Vishal L wrote:
> > On Wed, 2024-06-05 at 15:10 -0500, Sagi Shahar wrote:
> > > On Wed, Jun 5, 2024 at 1:38 PM Verma, Vishal L
> > > wrote:
> > > >
>
On Wed, Jun 5, 2024 at 3:56 PM Edgecombe, Rick P
wrote:
>
> On Wed, 2024-06-05 at 15:42 -0500, Sagi Shahar wrote:
> > > > Hm you're right, I was looking more narrowly because of the kvm-coco-
> > > > queue conflicts, for some of which even v19 might be too old.
From: Ackerley Tng
Support TDG.VP.VEINFO.GET that the guest uses to obtain the
virtualization exception information of the recent #VE
exception.
Signed-off-by: Ackerley Tng
Signed-off-by: Sagi Shahar
---
.../selftests/kvm/include/x86/tdx/tdx.h | 21 +++
tools/testing
43 matches
Mail list logo