Skip to content

Conversation

@hector-cao
Copy link
Collaborator

@hector-cao hector-cao commented Mar 21, 2025

There is a limit on the number of TDs that can be run in parralel.                         
This limit can be due to several factors, but the most prevalent factor                    
is the number of keys the CPU can allocate to TDs.                                         
In fact, TDX takes advantage of an existing CPU feature called MK-TME                      
(Multi-key Total Memory Encryption) to encrypt the VM memory. It enables                   
the CPU to encrypt each TD’s memory with a unique Advanced Encryption Standard (AES) key.  
MK-TME offers a number of keys and this key space is partionned into 2 sets:               
Shared (VMM) and Private (TDX). The number of key in the Private space defines the         
maximum number of TDs we can run in parralel.                                              
                                                                                           
This test verifies that we can run TDs up to this limit and any new TD creation            
is refused by qemu in a nice way.

You can run this test with:

$ cd tests
$ sudo ./tdtest -k 'test_stress_max_guests'

@hector-cao hector-cao requested a review from a team March 21, 2025 09:58
Copy link
Collaborator

@frenchwr frenchwr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hector-cao hector-cao merged commit be44415 into main Mar 21, 2025
2 checks passed
@hector-cao hector-cao deleted the dev-test-td-limit branch April 4, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants