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/[email protected]/ 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

