diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 68e751254..509e3b14c 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -1764,6 +1764,7 @@ impl Vm { // is safe to copy from the TDVF file into it. let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory(); let mem = guest_memory.memory(); + let mut payload_info = None; let mut hob_offset = None; for section in sections { info!("Populating TDVF Section: {:x?}", section); @@ -1823,6 +1824,13 @@ impl Vm { payload_size as usize, ) .unwrap(); + + // Create the payload info that will be inserted into + // the HOB. + payload_info = Some(PayloadInfo { + image_type: PayloadImageType::BzImage, + entry_point: section.address, + }); } } TdvfSectionType::PayloadParam => { @@ -1922,6 +1930,12 @@ impl Vm { .map_err(Error::PopulateHob)?; } + // If a payload info has been created, let's insert it into the HOB. + if let Some(payload_info) = payload_info { + hob.add_payload(&mem, payload_info) + .map_err(Error::PopulateHob)?; + } + hob.finish(&mem).map_err(Error::PopulateHob)?; Ok(hob_offset)