Skip to content

Commit 6e76536

Browse files
committed
add prints and host check
1 parent 65bbacc commit 6e76536

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

openhcl/openhcl_boot/src/host_params/dt.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ fn topology_from_persisted_state(
578578
ALLOCATOR.disable_alloc();
579579
ALLOCATOR.log_stats();
580580

581+
log!("read saved state {:#x?}", parsed_protobuf);
582+
581583
let loader_defs::shim::SavedState {
582584
partition_memory,
583585
partition_mmio,
@@ -622,6 +624,19 @@ fn topology_from_persisted_state(
622624
}),
623625
);
624626

627+
log!("restored vtl2 ram {:#x?}", vtl2_ram.as_slice());
628+
629+
// If the host was responsible for allocating VTL2 ram, verify the ram
630+
// parsed from the previous instance matches.
631+
if matches!(memory_allocation_mode, MemoryAllocationMode::Host) {
632+
let host_vtl2_ram = parse_host_vtl2_ram(params, &parsed.memory);
633+
assert_eq!(
634+
vtl2_ram.as_slice(),
635+
host_vtl2_ram.as_ref(),
636+
"vtl2 ram from persisted state does not match host provided ram"
637+
);
638+
}
639+
625640
// Merge the persisted state header and protobuf region, and report that as
626641
// the persisted region.
627642
//

openhcl/openhcl_boot/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ fn shim_main(shim_params_raw_offset: isize) -> ! {
526526
}
527527

528528
// Enable the in-memory log.
529-
boot_logger_init(p.isolation_type, true);
530529
boot_logger_memory_init(p.log_buffer);
531530

532531
let boot_reftime = get_ref_time(p.isolation_type);

0 commit comments

Comments
 (0)