Skip to content

Commit

Permalink
tool: Handle unaligned PD segments
Browse files Browse the repository at this point in the history
Correctly handle PD segments whose start vaddrs do not lie on page
boundaries.

Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin authored and Ivan-Velickovic committed Jan 12, 2024
1 parent d0f9718 commit c553c0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tool/microkit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,8 @@ def build_system(
if not segment.loadable:
continue

regions.append(Region(f"PD-ELF {pd.name}-{seg_idx}", phys_addr_next, segment.data))
segment_phys_addr = phys_addr_next + (segment.virt_addr % kernel_config.minimum_page_size)
regions.append(Region(f"PD-ELF {pd.name}-{seg_idx}", segment_phys_addr, segment.data))

perms = ""
if segment.is_readable:
Expand Down

0 comments on commit c553c0a

Please sign in to comment.