Skip to content

Commit

Permalink
hypervisor: Do not register ioevent for SEV-SNP
Browse files Browse the repository at this point in the history
... enabled VMs. IOEvents are not supported in case of SEV-SNP VMs. All
the IO events are delievered via GHCB protocol.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
Signed-off-by: Muminul Islam <muislam@microsoft.com>
  • Loading branch information
jinankjain authored and Jinank Jain committed Feb 9, 2024
1 parent 9a05490 commit bddd132
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hypervisor/src/mshv/mod.rs
Expand Up @@ -244,7 +244,6 @@ impl hypervisor::Hypervisor for MshvHypervisor {
}

// Set additional partition property for SEV-SNP partition.
let mut _sev_snp_enabled = mshv_vm_type == VmType::Snp;
if mshv_vm_type == VmType::Snp {
let snp_policy = snp::get_default_snp_guest_policy();
let vmgexit_offloads = snp::get_default_vmgexit_offload_features();
Expand Down Expand Up @@ -301,7 +300,7 @@ impl hypervisor::Hypervisor for MshvHypervisor {
msrs,
dirty_log_slots: Arc::new(RwLock::new(HashMap::new())),
#[cfg(feature = "sev_snp")]
sev_snp_enabled: _sev_snp_enabled,
sev_snp_enabled: mshv_vm_type == VmType::Snp,
}))
}

Expand Down Expand Up @@ -1584,6 +1583,11 @@ impl vm::Vm for MshvVm {
addr: &IoEventAddress,
datamatch: Option<DataMatch>,
) -> vm::Result<()> {
#[cfg(feature = "sev_snp")]
if self.sev_snp_enabled {
return Ok(());
}

let addr = &mshv_ioctls::IoEventAddress::from(*addr);
debug!(
"register_ioevent fd {} addr {:x?} datamatch {:?}",
Expand Down

0 comments on commit bddd132

Please sign in to comment.