]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
support/scripts: Ignore memory regions of length 0 in mkbootinfo.py
authorSergiu Moga <sergiu@unikraft.io>
Thu, 28 Sep 2023 16:10:39 +0000 (19:10 +0300)
committerRazvan Deaconescu <razvand@unikraft.io>
Fri, 20 Oct 2023 16:35:55 +0000 (19:35 +0300)
To avoid having the memory region map polluted with descriptors of
length 0, make sure that they are not inserted by `mkbootinfo.py`
either.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1060

support/scripts/mkbootinfo.py

index 3071ae8c884691db544b507c5c73cbc033d3057a..be73a8db34db898ac26fd279ee3b9bdc7b648806 100755 (executable)
@@ -123,6 +123,8 @@ def main():
 
             # Align size up to page size
             size = (int(phdr[1], base=16) + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1)
+            if size == 0:
+                continue
 
             assert nsecs < cap
             nsecs += 1