mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
vmm: implement AccessPlatform for SEV-SNP proxy struct
Implement AccessPlatform for SEV-SNP guest to access restricted page using IO. VMM calls MSHV api to get access of the pages, MSHV requests guest to release the access. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
parent
398e9338a7
commit
959ea7115f
@ -800,6 +800,20 @@ impl SevSnpPageAccessProxy {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "mshv", feature = "sev_snp"))]
|
||||
impl AccessPlatform for SevSnpPageAccessProxy {
|
||||
fn translate_gpa(&self, base: u64, _size: u64) -> std::result::Result<u64, std::io::Error> {
|
||||
Ok(base)
|
||||
}
|
||||
|
||||
fn translate_gva(&self, base: u64, size: u64) -> std::result::Result<u64, std::io::Error> {
|
||||
self.vm
|
||||
.gain_page_access(base, size as u32)
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
|
||||
Ok(base)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DeviceManager {
|
||||
// Manage address space related to devices
|
||||
address_manager: Arc<AddressManager>,
|
||||
|
Loading…
Reference in New Issue
Block a user