mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-07-05 01:12:36 +00:00
vmm: Fix loading RAW firmware
Whenever going through the codepath of loading a RAW firmware, we always add an extra RAM region to the guest memory through the memory manager. But we must be careful to use the updated guest memory rather than a previous reference that wasn't containing the new region, as this can lead to the following error: VmBoot(FirmwareLoad(InvalidGuestAddress(GuestAddress(4290772992)))) This is fixed by the current patch, getting the latest reference onto the guest memory from the memory manager right after the new region has been added. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
06f57abdf9
commit
5f722d0d3f
|
@ -1031,7 +1031,12 @@ impl Vm {
|
||||||
kernel
|
kernel
|
||||||
.seek(SeekFrom::Start(0))
|
.seek(SeekFrom::Start(0))
|
||||||
.map_err(Error::FirmwareFile)?;
|
.map_err(Error::FirmwareFile)?;
|
||||||
mem.read_exact_from(load_address, &mut kernel, size as usize)
|
memory_manager
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.guest_memory()
|
||||||
|
.memory()
|
||||||
|
.read_exact_from(load_address, &mut kernel, size as usize)
|
||||||
.map_err(Error::FirmwareLoad)?;
|
.map_err(Error::FirmwareLoad)?;
|
||||||
|
|
||||||
return Ok(EntryPoint { entry_addr: None });
|
return Ok(EntryPoint { entry_addr: None });
|
||||||
|
|
Loading…
Reference in New Issue
Block a user