vmm: add a proxy struct for SEV-SNP guest

Add a structure to hold the reference of the Vm trait
from Hypervisor crate to access of restricted page
from SEV-SNP guest.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam 2024-08-06 14:27:38 -07:00 committed by Liu Wei
parent 5c4b5c0e40
commit 398e9338a7

View File

@ -781,6 +781,25 @@ pub struct AcpiPlatformAddresses {
pub sleep_status_reg_address: Option<GenericAddress>,
}
#[cfg(all(feature = "mshv", feature = "sev_snp"))]
struct SevSnpPageAccessProxy {
vm: Arc<dyn hypervisor::Vm>,
}
#[cfg(all(feature = "mshv", feature = "sev_snp"))]
impl std::fmt::Debug for SevSnpPageAccessProxy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "SNP Page access proxy")
}
}
#[cfg(all(feature = "mshv", feature = "sev_snp"))]
impl SevSnpPageAccessProxy {
fn new(vm: Arc<dyn hypervisor::Vm>) -> SevSnpPageAccessProxy {
SevSnpPageAccessProxy { vm }
}
}
pub struct DeviceManager {
// Manage address space related to devices
address_manager: Arc<AddressManager>,