i386/sev: Add a class method to determine KVM VM type for SNP guests
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 31 May 2024 10:44:44 +0000 (12:44 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Jun 2024 09:01:06 +0000 (11:01 +0200)
commita808132f6d8e855bd83a400570ec91d2e00bebe3
treec168e1d1bc6a3bd8cdc4f386a11ca47b5c831e93
parent73ae63b162fc1fed520f53ad200712964d7d0264
i386/sev: Add a class method to determine KVM VM type for SNP guests

SEV guests can use either KVM_X86_DEFAULT_VM, KVM_X86_SEV_VM,
or KVM_X86_SEV_ES_VM depending on the configuration and what
the host kernel supports. SNP guests on the other hand can only
ever use KVM_X86_SNP_VM, so split determination of VM type out
into a separate class method that can be set accordingly for
sev-guest vs. sev-snp-guest objects and add handling for SNP.

Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
Message-ID: <20240530111643.1091816-14-pankaj.gupta@amd.com>
[Remove unnecessary function pointer declaration. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/kvm/kvm.c
target/i386/sev.c