Re: [RFC PATCH 01/11] KVM: selftests: sev_smoke_test: Only run VM types the host offers

From: Tycho Andersen

Date: Fri Jul 17 2026 - 10:54:52 EST


On Thu, Jul 16, 2026 at 10:31:21AM +0100, David Woodhouse wrote:
> From: David Woodhouse <dwmw@xxxxxxxxxxxx>
>
> sev_smoke_test ran the plain SEV subtest unconditionally, gated only on
> the X86_FEATURE_SEV CPUID bit, while gating SEV-ES and SNP on the
> KVM_CAP_VM_TYPES bits. CPUID reporting SEV does not mean KVM offers the
> SEV VM type: when all SEV ASIDs are assigned to SEV-SNP, KVM_X86_SEV_VM
> is unavailable even though X86_FEATURE_SEV is set. On such a host the
> test aborts in KVM_CREATE_VM instead of exercising the available modes.
>
> Gate the SEV subtest on KVM_CAP_VM_TYPES like the others, so the test
> runs the VM types the host actually offers.
>
> Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>

Reviewed-by: Tycho Andersen (AMD) <tycho@xxxxxxxxxx>