Skip to content

Commit dbb0607

Browse files
committed
size persisted region to 20 pages
1 parent 6e76536 commit dbb0607

File tree

1 file changed

+6
-7
lines changed
  • openhcl/openhcl_boot/src/host_params

1 file changed

+6
-7
lines changed

openhcl/openhcl_boot/src/host_params/dt.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,12 @@ fn topology_from_host_dt(
448448
..(params.parameter_region_start + params.parameter_region_size),
449449
);
450450

451-
// FIXME: decide how much to shrink the persisted range. This will
452-
// require some experimentation with figuring out how large the range
453-
// should be based on VP count + ram size and configuration, along with
454-
// accounting for potential growth in the future.
455-
//
456-
// For now, just use 1MB, even if the max supported size is 2MB.
457-
const PERSISTED_REGION_SIZE: u64 = 1024 * 1024;
451+
// NOTE: Size the region as 20 pages. This should be plenty enough for the
452+
// worst case encoded size (about 50 bytes worst case per memory entry, with
453+
// the max number of ram ranges), and is small enough that we can reserve it
454+
// on all sizes. Revisit this calculation if we persist more state in the
455+
// future.
456+
const PERSISTED_REGION_SIZE: u64 = 20 * 4096;
458457
let (persisted_state_region, remainder) = params
459458
.persisted_state
460459
.split_at_offset(PERSISTED_REGION_SIZE);

0 commit comments

Comments
 (0)