From 9b722bbcf6678758514a9bc43aa182385685efaa Mon Sep 17 00:00:00 2001 From: Jinank Jain Date: Tue, 20 Feb 2024 18:48:18 +0530 Subject: [PATCH] hypervisor: mshv: Don't unregister ioevent in case of SEV-SNP guest Since we don't register ioevents in case of SEV-SNP guests. Thus, we should not unregister it as well. Signed-off-by: Jinank Jain --- hypervisor/src/mshv/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index 01dd9a28c..9586a24b9 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -1622,6 +1622,11 @@ impl vm::Vm for MshvVm { /// Unregister an event from a certain address it has been previously registered to. fn unregister_ioevent(&self, fd: &EventFd, addr: &IoEventAddress) -> vm::Result<()> { + #[cfg(feature = "sev_snp")] + if self.sev_snp_enabled { + return Ok(()); + } + let addr = &mshv_ioctls::IoEventAddress::from(*addr); debug!("unregister_ioevent fd {} addr {:x?}", fd.as_raw_fd(), addr);