mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: skip uefi allocation on direct boot
A 4M uefi_region is allocated unconditionally. When directly booting a kernel, it goes unused. Avoid the allocation in this case by moving the call to add_uefi_flash() to load_firmware(). Also extended add_uefi_flash() to riscv64 since it shares the load_firmware() path. It looked like up to this point a firmware boot on riscv64 would panic with an uninitialized uefi_flash. Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
This commit is contained in:
@@ -1372,9 +1372,9 @@ impl MemoryManager {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
|
||||
pub fn add_uefi_flash(&mut self) -> Result<(), Error> {
|
||||
// On AArch64, the UEFI binary requires a flash device at address 0.
|
||||
// The UEFI binary requires a flash device at address 0.
|
||||
// 4 MiB memory is mapped to simulate the flash.
|
||||
let uefi_mem_slot = self.allocate_memory_slot();
|
||||
let uefi_region = GuestRegionMmap::new(
|
||||
|
||||
Reference in New Issue
Block a user