mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: update cache when a shared page is revoked
During the lifecycle of a confidential VM, the guest may revoke previously shared pages via an attribute-intercept VM exit. When this happens, the host-side cache must be updated so that any subsequent access by the VMM triggers a fresh request for the guest to re-share the page. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
@@ -740,6 +740,14 @@ impl cpu::Vcpu for MshvVcpu {
|
||||
let mut gpas = Vec::new();
|
||||
let ranges = info.ranges;
|
||||
let (gfn_start, gfn_count) = snp::parse_gpa_range(ranges[0]).unwrap();
|
||||
|
||||
// Update the bitmap(cache) to mark the pages as host inaccessible
|
||||
self.host_access_pages.rcu(|bitmap| {
|
||||
let bm = bitmap.clone();
|
||||
bm.reset_addr_range(gfn_start as usize, gfn_count as usize);
|
||||
bm
|
||||
});
|
||||
|
||||
debug!("Releasing pages: gfn_start: {gfn_start:x?}, gfn_count: {gfn_count:?}");
|
||||
let gpa_start = gfn_start * HV_PAGE_SIZE as u64;
|
||||
for i in 0..gfn_count {
|
||||
|
||||
Reference in New Issue
Block a user