hypervisor, vmm: pass SNP guest policy to sev_snp_init

The SNP guest policy (AMD SEV-SNP ABI bits controlling SMT, migration,
debug, etc.) was previously hardcoded inside the MSHV implementation.
Widen Vm::sev_snp_init() to accept an SnpPolicy parameter so each
hypervisor backend receives the policy at init time.

Add get_default_sev_snp_guest_policy() in the VMM to construct the
default policy.

Co-authored-by: Keith Adler <kadler@cloudflare.com>
Signed-off-by: Keith Adler <kadler@cloudflare.com>
Co-authored-by: Alex Orozco <aorozco@google.com>
Signed-off-by: Alex Orozco <aorozco@google.com>
Signed-off-by: Ruben Hakobyan <hruben@meta.com>
This commit is contained in:
Ruben Hakobyan
2026-04-07 08:09:58 -07:00
committed by Rob Bradford
parent 8ee0a07ab1
commit b545b2fc4e
4 changed files with 28 additions and 5 deletions
+6 -1
View File
@@ -32,7 +32,12 @@ mshv = [
"vm-device/mshv",
]
pvmemcontrol = ["devices/pvmemcontrol"]
sev_snp = ["arch/sev_snp", "hypervisor/sev_snp", "virtio-devices/sev_snp"]
sev_snp = [
"arch/sev_snp",
"hypervisor/sev_snp",
"igvm_defs",
"virtio-devices/sev_snp",
]
tdx = ["arch/tdx", "hypervisor/tdx"]
tracing = ["tracer/tracing"]