mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
vmm: pass AccessPlatform implementation for SEV-SNP guest
Passing AccessPlatform trait to virtio-device for requesting restricting page access during IO for SEV-SNP guest. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
parent
959ea7115f
commit
1e967697c2
@ -3741,15 +3741,22 @@ impl DeviceManager {
|
|||||||
// Create the AccessPlatform trait from the implementation IommuMapping.
|
// Create the AccessPlatform trait from the implementation IommuMapping.
|
||||||
// This will provide address translation for any virtio device sitting
|
// This will provide address translation for any virtio device sitting
|
||||||
// behind a vIOMMU.
|
// behind a vIOMMU.
|
||||||
let access_platform: Option<Arc<dyn AccessPlatform>> = if let Some(mapping) = iommu_mapping
|
let mut access_platform: Option<Arc<dyn AccessPlatform>> = None;
|
||||||
{
|
|
||||||
Some(Arc::new(AccessPlatformMapping::new(
|
if let Some(mapping) = iommu_mapping {
|
||||||
|
access_platform = Some(Arc::new(AccessPlatformMapping::new(
|
||||||
pci_device_bdf.into(),
|
pci_device_bdf.into(),
|
||||||
mapping.clone(),
|
mapping.clone(),
|
||||||
)))
|
)));
|
||||||
} else {
|
}
|
||||||
None
|
|
||||||
};
|
// If SEV-SNP is enabled create the AccessPlatform from SevSnpPageAccessProxy
|
||||||
|
#[cfg(feature = "sev_snp")]
|
||||||
|
if self.config.lock().unwrap().is_sev_snp_enabled() {
|
||||||
|
access_platform = Some(Arc::new(SevSnpPageAccessProxy::new(
|
||||||
|
self.address_manager.vm.clone(),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
let memory = self.memory_manager.lock().unwrap().guest_memory();
|
let memory = self.memory_manager.lock().unwrap().guest_memory();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user