Skip to content

Commit 9a92c40

Browse files
committed
fixup! [host/hypervisor_handler,host/mem/{layout,mgr},docs/paging] moved guest code to start at 0x0 instead of after paging sections
1 parent 40a8091 commit 9a92c40

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hyperlight_host/src/mem/layout.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ impl SandboxMemoryLayout {
313313
heap_size: usize,
314314
) -> Result<Self> {
315315
let guest_code_offset = 0x0;
316-
let total_page_table_size = Self::get_total_page_table_size(cfg, code_size, stack_size, heap_size);
316+
let total_page_table_size =
317+
Self::get_total_page_table_size(cfg, code_size, stack_size, heap_size);
317318
let paging_sections_offset = guest_code_offset + round_up_to(code_size, PAGE_SIZE_USIZE);
318319
// The following offsets are to the fields of the PEB struct itself!
319320
let peb_offset = total_page_table_size + round_up_to(code_size, PAGE_SIZE_USIZE);

src/hyperlight_host/src/mem/mgr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ where
166166

167167
for i in 0..512 {
168168
let offset = self.layout.get_pd_offset() + (i * 8);
169-
let val_to_write: u64 = (self.layout.get_pt_offset() as u64
170-
+ (i * 4096) as u64)
169+
let val_to_write: u64 = (self.layout.get_pt_offset() as u64 + (i * 4096) as u64)
171170
| PAGE_PRESENT
172171
| PAGE_RW;
173172
shared_mem.write_u64(offset, val_to_write)?;

0 commit comments

Comments
 (0)