mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Store boot guest memory and use it for boot sequence
In order to differentiate the 'boot' memory regions from the virtio-mem regions, we store what we call 'boot_guest_memory'. This is useful to provide the adequate list of regions to the configure_system() function as it expects only the list of regions that should be exposed through the e820 table. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -684,11 +684,10 @@ impl Vm {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
fn configure_system(&mut self, entry_addr: EntryPoint) -> Result<()> {
|
||||
let cmdline_cstring = self.get_cmdline()?;
|
||||
let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory();
|
||||
let mem = guest_memory.memory();
|
||||
let mem = self.memory_manager.lock().unwrap().boot_guest_memory();
|
||||
|
||||
let initramfs_config = match self.initramfs {
|
||||
Some(_) => Some(self.load_initramfs(mem.deref())?),
|
||||
Some(_) => Some(self.load_initramfs(&mem)?),
|
||||
None => None,
|
||||
};
|
||||
|
||||
@@ -700,7 +699,7 @@ impl Vm {
|
||||
#[cfg(feature = "acpi")]
|
||||
{
|
||||
rsdp_addr = Some(crate::acpi::create_acpi_tables(
|
||||
mem.deref(),
|
||||
&mem,
|
||||
&self.device_manager,
|
||||
&self.cpu_manager,
|
||||
&self.memory_manager,
|
||||
@@ -753,10 +752,9 @@ impl Vm {
|
||||
fn configure_system(&mut self, _entry_addr: EntryPoint) -> Result<()> {
|
||||
let cmdline_cstring = self.get_cmdline()?;
|
||||
let vcpu_mpidrs = self.cpu_manager.lock().unwrap().get_mpidrs();
|
||||
let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory();
|
||||
let mem = guest_memory.memory();
|
||||
let mem = self.memory_manager.lock().unwrap().boot_guest_memory();
|
||||
let initramfs_config = match self.initramfs {
|
||||
Some(_) => Some(self.load_initramfs(mem.deref())?),
|
||||
Some(_) => Some(self.load_initramfs(&mem)?),
|
||||
None => None,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user