From fa93dd3c5e27f898c9abd7f241ccb5f9130b8dc7 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Wed, 19 Jun 2024 11:01:38 +0200 Subject: [PATCH] Replace hardcoded arch::RAM_START in BootInfo There was an idea to initialize the mmap using different guest_address parameters. Despite how most of the code is already "future-proofed", with a clear intention of heading towards that direction and `vm.rs` using `self.mem.guest_address` everywhere (despite that value currently being equal to zero), this change modifies a small exception to that rule. --- src/vm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vm.rs b/src/vm.rs index 8f0ba51a..e058cbb7 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -201,8 +201,8 @@ impl UhyveVm { let boot_info = BootInfo { hardware_info: HardwareInfo { - phys_addr_range: arch::RAM_START.as_u64() - ..arch::RAM_START.as_u64() + self.mem.memory_size as u64, + phys_addr_range: self.mem.guest_address.as_u64() + ..self.mem.guest_address.as_u64() + self.mem.memory_size as u64, serial_port_base: self.verbose().then(|| { SerialPortBase::new((uhyve_interface::HypercallAddress::Uart as u16).into()) .unwrap()