From c553c0a8eb69dc8e8757a561d20f8c2f9e77ceb1 Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Tue, 24 Jan 2023 16:28:25 +0000 Subject: [PATCH] tool: Handle unaligned PD segments Correctly handle PD segments whose start vaddrs do not lie on page boundaries. Signed-off-by: Nick Spinale --- tool/microkit/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tool/microkit/__main__.py b/tool/microkit/__main__.py index fe2c9b1d..a4359307 100644 --- a/tool/microkit/__main__.py +++ b/tool/microkit/__main__.py @@ -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: