vmm: Don't store GuestMemoryMmap for "guest_debug" functionality

This removes the storage of the GuestMemoryMmap on the CpuManager
further allowing the decoupling of the CpuManager from the
MemoryManager.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-12-01 14:23:50 +00:00
parent c7b22156da
commit c5eac2e822
3 changed files with 34 additions and 17 deletions

View File

@@ -5,6 +5,7 @@
//
// SPDX-License-Identifier: BSD-3-Clause
use crate::GuestMemoryMmap;
use gdbstub::{
arch::Arch,
common::{Signal, Tid},
@@ -33,7 +34,7 @@ use gdbstub_arch::x86::reg::X86_64CoreRegs as CoreRegs;
#[cfg(target_arch = "x86_64")]
use gdbstub_arch::x86::X86_64_SSE as GdbArch;
use std::{os::unix::net::UnixListener, sync::mpsc};
use vm_memory::{GuestAddress, GuestMemoryError};
use vm_memory::{GuestAddress, GuestMemoryAtomic, GuestMemoryError};
type ArchUsize = u64;
@@ -67,12 +68,14 @@ pub trait Debuggable: vm_migration::Pausable {
) -> std::result::Result<(), DebuggableError>;
fn read_mem(
&self,
guest_memory: &GuestMemoryAtomic<GuestMemoryMmap>,
cpu_id: usize,
vaddr: GuestAddress,
len: usize,
) -> std::result::Result<Vec<u8>, DebuggableError>;
fn write_mem(
&self,
guest_memory: &GuestMemoryAtomic<GuestMemoryMmap>,
cpu_id: usize,
vaddr: &GuestAddress,
data: &[u8],