rface to manually flag protected/encrypted
ranges
KVM: selftests: Add a CoCo-specific test for KVM_PRE_FAULT_MEMORY
Pratik R. Sampat (7):
KVM: selftests: Decouple SEV ioctls from asserts
KVM: selftests: Add a basic SNP smoke test
KVM: selftests: Add SNP to shutdown testing
KVM: self
Add variants of sev, sev-es launch path that return the status of the
ioctl call instead of asserting for success. This enables both positive
and negative testing of the path.
No functional impact intended.
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
of the type KVM_EXIT_SYSTEM_EVENT.
Also, decouple policy and type and require functions to provide both
such that there is no assumption regarding the type using policy.
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
---
.../selftests/kvm/include/x86_64
Parameterize the shutdown test to include the SEV-SNP VM type
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
---
tools/testing/selftests/kvm/x86_64/sev_smoke_test.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing
Introduce tests for sev and sev-es ioctl that exercises the boot path
of launch, update and finish on an invalid policy.
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
---
.../selftests/kvm/x86_64/sev_smoke_test.c | 84 +++
1 file changed
Introduce testing of SNP ioctl calls. Tests attributes such as flags,
page types, and policies in various combinations along the SNP launch
path.
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
---
.../testing/selftests/kvm/include/kvm_util.h | 11
Add SEV-SNP VM type to exercise the KVM_SEV_INIT2 call.
Also ensure that SNP case is skipped for scenarios where CPUID supports
it but KVM does not so that a failure is not reported for such cases.
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
l Roth
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
---
.../testing/selftests/kvm/include/kvm_util.h | 2 +
tools/testing/selftests/kvm/lib/kvm_util.c| 45 +--
2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/tools/t
SEV, SEV-ES, and SNP.
Since there's a reasonable chance that TDX could extend this for similar
testing of TDX, give it a "coco-" prefix rather than an SEV-specific
one.
Signed-off-by: Michael Roth
Co-developed-by: Pratik R. Sampat
Signed-off-by: Pratik R. Sampat
Tested-by: Peter G
statuses.
Signed-off-by: Pratik R. Sampat
Tested-by: Peter Gonda
Tested-by: Srikanth Aithal
---
.../kvm/x86_64/coco_pre_fault_memory_test.c | 121 +-
1 file changed, 114 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/coco_pre_fault_memory_test.c
b
Hi Sean,
On 10/14/2024 5:18 PM, Sean Christopherson wrote:
> On Thu, Sep 05, 2024, Pratik R. Sampat wrote:
>> +static inline int __sev_launch_update_data(struct kvm_vm *vm, vm_paddr_t
>> gpa,
>> + uint64_t hva, uint64_t size)
Hi Sean,
Thank you for your comments.
...
>> .../selftests/kvm/include/x86_64/processor.h | 1 +
>> .../selftests/kvm/include/x86_64/sev.h| 54 +++-
>> tools/testing/selftests/kvm/lib/kvm_util.c| 8 +-
>> .../selftests/kvm/lib/x86_64/processor.c | 6 +-
>> tools/test
Hi Sean,
On 10/14/2024 5:23 PM, Sean Christopherson wrote:
> On Thu, Sep 05, 2024, Pratik R. Sampat wrote:
>> This series primarily introduces SEV-SNP test for the kernel selftest
>> framework. It tests boot, ioctl, pre fault, and fallocate in various
>> combinations to exerc
Hi Sean,
On 10/14/2024 5:58 PM, Sean Christopherson wrote:
> On Thu, Sep 05, 2024, Pratik R. Sampat wrote:
>> From: Michael Roth
>>
>> For SEV and SNP, currently __vm_phy_pages_alloc() handles setting the
>> region->protected_phy_pages bitmap to mark that the r
Hi Sean,
On 10/28/2024 12:55 PM, Sean Christopherson wrote:
> On Mon, Oct 21, 2024, Pratik R. Sampat wrote:
>>>> + test_sev(guest_sev_es_code, KVM_X86_SEV_ES_VM, SEV_POLICY_ES);
>>>>
>>>>test_sev_es_shutdown();
>>>
On 11/4/2024 5:47 PM, Sean Christopherson wrote:
> On Mon, Nov 04, 2024, Pratik R. Sampat wrote:
>>
>>
>> On 10/31/2024 11:27 AM, Sean Christopherson wrote:
>>> On Thu, Oct 31, 2024, Pratik R. Sampat wrote:
>>>> Hi Sean,
>>>>
>>>&g
On 10/31/2024 11:27 AM, Sean Christopherson wrote:
> On Thu, Oct 31, 2024, Pratik R. Sampat wrote:
>> Hi Sean,
>>
>> On 10/30/2024 12:57 PM, Sean Christopherson wrote:
>>> On Wed, Oct 30, 2024, Pratik R. Sampat wrote:
>>>> On 10/30/2024 8:46 AM, Se
Hi Sean,
On 10/30/2024 8:46 AM, Sean Christopherson wrote:
> On Mon, Oct 28, 2024, Pratik R. Sampat wro4te:
>> On 10/28/2024 12:55 PM, Sean Christopherson wrote:
>>> On Mon, Oct 21, 2024, Pratik R. Sampat wrote:
>>>>>> +
Hi Sean,
On 10/30/2024 12:57 PM, Sean Christopherson wrote:
> On Wed, Oct 30, 2024, Pratik R. Sampat wrote:
>> On 10/30/2024 8:46 AM, Sean Christopherson wrote:
>>> +/* Minimum firmware version required for the SEV-SNP support */
>>> +#define SNP_FW_REQ
In preparation for SNP, declutter the vm type check by introducing a
SEV-SNP VM type check as well a transitive set of helper functions.
The SNP VM type is the subset of SEV-ES. Similarly, the SEV-ES and SNP
types are subset of the SEV VM type check.
Signed-off-by: Pratik R. Sampat
Abstract rep vmmcall coded into the VMGEXIT helper for the sev
library.
No functional change intended.
Signed-off-by: Pratik R. Sampat
---
tools/testing/selftests/kvm/include/x86_64/sev.h| 2 ++
tools/testing/selftests/kvm/x86_64/sev_smoke_test.c | 2 +-
2 files changed, 3 insertions(+), 1
In preparation for SNP, cleanup the smoke test to decouple deriving
type from policy. Introduce, wrappers for SEV and SEV-ES types to
abstract the parametrized launch tests calls and reduce verbosity.
No functional change intended.
Signed-off-by: Pratik R. Sampat
---
.../selftests/kvm/x86_64
Force the SEV-SNP VM type to set the KVM_MEM_GUEST_MEMFD flag for the
creation of private memslots.
Signed-off-by: Pratik R. Sampat
---
tools/testing/selftests/kvm/lib/kvm_util.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/lib
of the type KVM_EXIT_SYSTEM_EVENT.
Signed-off-by: Pratik R. Sampat
---
.../selftests/kvm/x86_64/sev_smoke_test.c | 42 +++
1 file changed, 42 insertions(+)
diff --git a/tools/testing/selftests/kvm/x86_64/sev_smoke_test.c
b/tools/testing/selftests/kvm/x86_64/sev_smoke_test.c
: Add initial SEV-SNP support")
Signed-off-by: Pratik R. Sampat
---
arch/x86/kvm/svm/sev.c | 4 +++-
drivers/crypto/ccp/sev-dev.c | 6 ++
include/linux/psp-sev.h | 3 +++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/s
Extend the SEV library to include support for SNP ioctl() wrappers,
which aid in launching and interacting with a SEV-SNP guest.
Signed-off-by: Pratik R. Sampat
---
.../selftests/kvm/include/x86_64/sev.h| 49 ++-
tools/testing/selftests/kvm/lib/x86_64/sev.c | 81
/20240905124107.6954-1-pratikrajesh.sam...@amd.com/
1. Remove the assignments for the prefault and fallocate test type
enums.
2. Fix error message for sev launch measure and finish.
3. Collect tested-by tags [Peter, Srikanth]
Any feedback/review is highly appreciated!
Pratik R. Sampat (8):
KVM: SEV: Disable
Add the X86_FEATURE_SNP CPU feature to the architectural definition for
the SEV-SNP VM type to exercise the KVM_SEV_INIT2 call. Ensure that the
SNP test is skipped in scenarios where CPUID supports it but KVM does
not, so that a failure is not reported in such cases.
Signed-off-by: Pratik R
Extend the SEV library to include support for SNP ioctl() wrappers,
which aid in launching and interacting with a SEV-SNP guest.
Signed-off-by: Pratik R. Sampat
---
arch/x86/include/uapi/asm/kvm.h | 1 +
tools/arch/x86/include/uapi/asm/kvm.h | 1 +
tools/testing
Abstract rep vmmcall coded into the vmgexit helper for the sev
library.
No functional change intended.
Signed-off-by: Pratik R. Sampat
---
tools/testing/selftests/kvm/include/x86/sev.h| 5 +
tools/testing/selftests/kvm/x86/sev_smoke_test.c | 2 +-
2 files changed, 6 insertions(+), 1
In preparation for SNP, declutter the vm type check by introducing a
SEV-SNP VM type check as well as a transitive set of helper functions.
The SNP VM type is the subset of SEV-ES. Similarly, the SEV-ES and SNP
types are subset of the SEV VM type check.
Signed-off-by: Pratik R. Sampat
Force the SEV-SNP VM type to set the KVM_MEM_GUEST_MEMFD flag for the
creation of private memslots.
Signed-off-by: Pratik R. Sampat
---
tools/testing/selftests/kvm/lib/kvm_util.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/lib
For SEV tests, assert() failures on VM type or fd do not provide
sufficient error reporting. Replace assert() with TEST_ASSERT_EQ() to
obtain more detailed information on the assertion condition failure,
including the call stack.
Signed-off-by: Pratik R. Sampat
---
tools/testing/selftests/kvm
or sev launch measure and finish.
* Collect tested-by tags [Peter, Srikanth]
Pratik R. Sampat (10):
KVM: SEV: Disable SEV-SNP support on initialization failure
KVM: selftests: SEV-SNP test for KVM_SEV_INIT2
KVM: selftests: Add vmgexit helper
KVM: selftests: Add SMT control state helper
Dadhania
Signed-off-by: Pratik R. Sampat
---
tools/testing/selftests/kvm/include/x86/processor.h | 1 +
tools/testing/selftests/kvm/x86/sev_init2_tests.c | 13 +
2 files changed, 14 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/x86/processor.h
b/tools/testing
additional condition to determine support for SEV-SNP.
Fixes: 1dfe571c12cf ("KVM: SEV: Add initial SEV-SNP support")
Suggested-by: Sean Christopherson
Signed-off-by: Pratik R. Sampat
---
v7..v8:
* Avoid exporting yet another API from CCP. Instead query
SNP_PLATFORM_STATUS to get the c
In preparation for SNP, cleanup the smoke test to decouple deriving type
from policy. This enables us to reuse existing interfaces as well as
deduplicate the test calls that are called for SEV and SEV-ES.
No functional change intended.
Signed-off-by: Pratik R. Sampat
---
.../selftests/kvm/x86
: Pratik R. Sampat
---
.../testing/selftests/kvm/include/kvm_util.h | 35 +++
.../testing/selftests/kvm/x86/hyperv_cpuid.c | 19 --
2 files changed, 35 insertions(+), 19 deletions(-)
diff --git a/tools/testing/selftests/kvm/include/kvm_util.h
b/tools/testing/selftests/kvm
of the type KVM_EXIT_SYSTEM_EVENT.
Signed-off-by: Pratik R. Sampat
---
.../selftests/kvm/x86/sev_smoke_test.c| 25 +--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86/sev_smoke_test.c
b/tools/testing/selftests/kvm/x86
39 matches
Mail list logo