Skip to content

vmm_core: Remove is_mmio from CpuIo #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tmk/tmk_vmm/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> {
None
}
Expand Down
4 changes: 0 additions & 4 deletions vmm_core/src/vmotherboard_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> {
self.chipset.acknowledge_pic_interrupt()
}
Expand Down
3 changes: 0 additions & 3 deletions vmm_core/virt/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>;
Expand Down
4 changes: 0 additions & 4 deletions vmm_core/virt_support_x86emu/tests/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> {
todo!()
}
Expand Down
1 change: 0 additions & 1 deletion vmm_core/virt_whp/src/vp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions vmm_core/vmotherboard/src/chipset/io_ranges/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ impl<T: RangeKey> IoRanges<T> {
.take()
.expect("must only be called once")
}

pub fn is_occupied(&self, addr: T) -> bool {
self.inner.read().map.contains(&addr)
}
}

pub struct LookupResult {
Expand Down
5 changes: 0 additions & 5 deletions vmm_core/vmotherboard/src/chipset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down