From 468875453450ecdf4abbd58973f73dd50396ba53 Mon Sep 17 00:00:00 2001 From: Steven Malis Date: Tue, 6 May 2025 12:25:47 -0400 Subject: [PATCH] Remove is_mmio --- tmk/tmk_vmm/src/run.rs | 4 ---- vmm_core/src/vmotherboard_adapter.rs | 4 ---- vmm_core/virt/src/io.rs | 3 --- vmm_core/virt_support_x86emu/tests/tests/common.rs | 4 ---- vmm_core/virt_whp/src/vp.rs | 1 - vmm_core/vmotherboard/src/chipset/io_ranges/mod.rs | 4 ---- vmm_core/vmotherboard/src/chipset/mod.rs | 5 ----- 7 files changed, 25 deletions(-) diff --git a/tmk/tmk_vmm/src/run.rs b/tmk/tmk_vmm/src/run.rs index 30ce3519bb..e5a7d04e19 100644 --- a/tmk/tmk_vmm/src/run.rs +++ b/tmk/tmk_vmm/src/run.rs @@ -247,10 +247,6 @@ fn widen(d: &[u8]) -> u64 { } impl CpuIo for IoHandler<'_> { - fn is_mmio(&self, _address: u64) -> bool { - false - } - fn acknowledge_pic_interrupt(&self) -> Option { None } diff --git a/vmm_core/src/vmotherboard_adapter.rs b/vmm_core/src/vmotherboard_adapter.rs index a4fdebed27..158f21d357 100644 --- a/vmm_core/src/vmotherboard_adapter.rs +++ b/vmm_core/src/vmotherboard_adapter.rs @@ -31,10 +31,6 @@ impl ChipsetPlusSynic { } impl CpuIo for ChipsetPlusSynic { - fn is_mmio(&self, address: u64) -> bool { - self.chipset.is_mmio(address) - } - fn acknowledge_pic_interrupt(&self) -> Option { self.chipset.acknowledge_pic_interrupt() } diff --git a/vmm_core/virt/src/io.rs b/vmm_core/virt/src/io.rs index 0284b25fe4..d2e4f0b559 100644 --- a/vmm_core/virt/src/io.rs +++ b/vmm_core/virt/src/io.rs @@ -8,9 +8,6 @@ use vm_topology::processor::VpIndex; /// This trait provides the operations between the VP dispatch loop and the /// platform's devices. pub trait CpuIo { - /// Check if a given address will be handled by a device. - fn is_mmio(&self, address: u64) -> bool; - /// Gets the vector of the next interrupt to inject from the legacy /// interrupt controller (PIC) and sets the IRQ in service. fn acknowledge_pic_interrupt(&self) -> Option; diff --git a/vmm_core/virt_support_x86emu/tests/tests/common.rs b/vmm_core/virt_support_x86emu/tests/tests/common.rs index 9513d91eb1..df41e25b06 100644 --- a/vmm_core/virt_support_x86emu/tests/tests/common.rs +++ b/vmm_core/virt_support_x86emu/tests/tests/common.rs @@ -49,10 +49,6 @@ pub fn long_protected_mode(user_mode: bool) -> CpuState { pub struct MockCpu; impl CpuIo for MockCpu { - fn is_mmio(&self, _address: u64) -> bool { - todo!() - } - fn acknowledge_pic_interrupt(&self) -> Option { todo!() } diff --git a/vmm_core/virt_whp/src/vp.rs b/vmm_core/virt_whp/src/vp.rs index 2feba4eee0..0a0fb841dc 100644 --- a/vmm_core/virt_whp/src/vp.rs +++ b/vmm_core/virt_whp/src/vp.rs @@ -802,7 +802,6 @@ mod x86 { if self.intercept_state().is_some() && self.state.active_vtl == Vtl::Vtl0 - && !dev.is_mmio(access.Gpa) && self .state .vtls diff --git a/vmm_core/vmotherboard/src/chipset/io_ranges/mod.rs b/vmm_core/vmotherboard/src/chipset/io_ranges/mod.rs index 71a0cac0a6..3e920653de 100644 --- a/vmm_core/vmotherboard/src/chipset/io_ranges/mod.rs +++ b/vmm_core/vmotherboard/src/chipset/io_ranges/mod.rs @@ -195,10 +195,6 @@ impl IoRanges { .take() .expect("must only be called once") } - - pub fn is_occupied(&self, addr: T) -> bool { - self.inner.read().map.contains(&addr) - } } pub struct LookupResult { diff --git a/vmm_core/vmotherboard/src/chipset/mod.rs b/vmm_core/vmotherboard/src/chipset/mod.rs index 56bc07b79e..2f1e95c212 100644 --- a/vmm_core/vmotherboard/src/chipset/mod.rs +++ b/vmm_core/vmotherboard/src/chipset/mod.rs @@ -207,11 +207,6 @@ impl Chipset { .await } - /// Check if a MMIO device exists at the given address - pub fn is_mmio(&self, addr: u64) -> bool { - self.mmio_ranges.is_occupied(addr) - } - /// Dispatch a Port IO read to the given address. pub async fn io_read(&self, vp: u32, port: u16, data: &mut [u8]) { let lookup = self.pio_ranges.lookup(port, true);