From b163fea66a33873e7ca4fa0bde84a95533902369 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Wed, 26 Nov 2025 15:24:55 -0800 Subject: [PATCH] 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 --- hypervisor/src/mshv/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index d4ececd8e..6b2d67864 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -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 {