Re: [PATCH v2 1/2] KVM: selftests: SEV: Verify unsupported VM types are rejected at creation
From: Hemanth Selam
Date: Fri Jul 10 2026 - 01:07:03 EST
On Thu, Jul 09, 2026, Sean Christopherson wrote:
> Literally every test relies on the kernel to clean up fds on an early
> exit. I see no reason for this to behave differently.
>
> Also, Sashiko was wrong. If KVM_CREATE_VM fails with something other
> than EINVAL, the assert will NOT fire, but fd will be < 0.
Agreed on both; dropped the manual close() and the errno latching.
> test_assert logs the errno, no need to spit it out here as well.
Removed.
> Heh, I agree with the comment: put this in a separate selftest. This
> doesn't have anything to do with KVM_SEV_INIT2, and in fact doesn't
> even have anyting to do with SEV+ or even x86. E.g. add a
> kvm_vm_types_test that attempts to create all possible VM types, and
> asserts success/failure based on the output from
> kvm_check_cap(KVM_CAP_VM_TYPES).
Done. v3 drops the sev_init2_tests changes and adds a standalone,
arch-generic test that walks all type values (including out-of-range
ones) and asserts KVM_CREATE_VM success/failure against
KVM_CAP_VM_TYPES:
https://lore.kernel.org/all/20260710050442.826777-1-hemanth.selam@xxxxxxxxx/
I also dropped the "SEV: Sanity check the launch measurement" patch for
now; v3 is just the VM-types test.
Thanks for the review!
Hemanth