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 committed Oct 25, 2023
1 parent 95a4ab3 commit d6b52d9
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 @@ -992,7 +992,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 d6b52d9

Please sign in to comment.