mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Add KvmSevSnpIdBlock and KvmSevSnpIdAuth structs matching the AMD SEV-SNP Firmware ABI Spec (Rev 1.58), and build them from the IGVM SNP ID block directive during launch finish. This properly populates id_block_uaddr/id_auth_uaddr in KVM_SEV_SNP_LAUNCH_FINISH and derives auth_key_en from the assembled author key, matching QEMU's behavior. Thread the guest policy from sev_snp_init to launch_finish via an atomic on KvmVm so the ID block gets the correct policy value. Also track has_snp_id_block in IgvmLoadedInfo to enable the ID block based on whether the IGVM file actually contains one, rather than hardcoding it for KVM. Signed-off-by: Ruben Hakobyan <hruben@meta.com>