mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -2311,11 +2311,16 @@ impl Vm {
|
||||
self.write_regs(cpu_id, regs).map_err(Error::Debug)?;
|
||||
}
|
||||
ReadMem(vaddr, len) => {
|
||||
let mem = self.read_mem(cpu_id, *vaddr, *len).map_err(Error::Debug)?;
|
||||
let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory();
|
||||
let mem = self
|
||||
.read_mem(&guest_memory, cpu_id, *vaddr, *len)
|
||||
.map_err(Error::Debug)?;
|
||||
return Ok(GdbResponsePayload::MemoryRegion(mem));
|
||||
}
|
||||
WriteMem(vaddr, data) => {
|
||||
self.write_mem(cpu_id, vaddr, data).map_err(Error::Debug)?;
|
||||
let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory();
|
||||
self.write_mem(&guest_memory, cpu_id, vaddr, data)
|
||||
.map_err(Error::Debug)?;
|
||||
}
|
||||
ActiveVcpus => {
|
||||
let active_vcpus = self.active_vcpus();
|
||||
@@ -2656,6 +2661,7 @@ impl Debuggable for Vm {
|
||||
|
||||
fn read_mem(
|
||||
&self,
|
||||
guest_memory: &GuestMemoryAtomic<GuestMemoryMmap>,
|
||||
cpu_id: usize,
|
||||
vaddr: GuestAddress,
|
||||
len: usize,
|
||||
@@ -2663,11 +2669,12 @@ impl Debuggable for Vm {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.read_mem(cpu_id, vaddr, len)
|
||||
.read_mem(guest_memory, cpu_id, vaddr, len)
|
||||
}
|
||||
|
||||
fn write_mem(
|
||||
&self,
|
||||
guest_memory: &GuestMemoryAtomic<GuestMemoryMmap>,
|
||||
cpu_id: usize,
|
||||
vaddr: &GuestAddress,
|
||||
data: &[u8],
|
||||
@@ -2675,7 +2682,7 @@ impl Debuggable for Vm {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.write_mem(cpu_id, vaddr, data)
|
||||
.write_mem(guest_memory, cpu_id, vaddr, data)
|
||||
}
|
||||
|
||||
fn active_vcpus(&self) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user