diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index 37c1b3d24..ca3959bb0 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -237,6 +237,7 @@ impl hypervisor::Hypervisor for MshvHypervisor { // Set additional partition property for SEV-SNP partition. if mshv_vm_type == VmType::Snp { let snp_policy = snp::get_default_snp_guest_policy(); + let vmgexit_offloads = snp::get_default_vmgexit_offload_features(); // SAFETY: access union fields unsafe { debug!( @@ -248,6 +249,15 @@ impl hypervisor::Hypervisor for MshvHypervisor { snp_policy.as_uint64, ) .map_err(|e| hypervisor::HypervisorError::SetPartitionProperty(e.into()))?; + debug!( + "Setting the partition property to enable VMGEXIT offloads as : 0x{:x}", + vmgexit_offloads.as_uint64 + ); + fd.set_partition_property( + hv_partition_property_code_HV_PARTITION_PROPERTY_SEV_VMGEXIT_OFFLOADS, + vmgexit_offloads.as_uint64, + ) + .map_err(|e| hypervisor::HypervisorError::SetPartitionProperty(e.into()))?; } }