]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
support/scripts: Allow overlapping bootinfo region
authorMarc Rittinghaus <marc.rittinghaus@unikraft.io>
Sat, 4 Feb 2023 04:32:20 +0000 (05:32 +0100)
committerUnikraft <monkey@unikraft.io>
Sun, 5 Feb 2023 01:02:00 +0000 (01:02 +0000)
Preliminary fix: Unikraft expects memory regions in the boot info
to not overlap and be page aligned. This is, however, not
compatible with having the .tdata section being assigned its
dedicated segment. This commit removes the sanity checks for
now as Unikraft can handle this specific case.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Michalis Pappas <michalis.pappas@opensynergy.com>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #746

support/scripts/mkbootinfo.py

index 051c700c7fa3e82848b28c5236abfa6ba2cfb3cf..cfc5cd076253c7a25f8f341b019b65d41eb22752 100755 (executable)
@@ -80,7 +80,6 @@ def main():
     # struct ukplat_memregion_desc (see include/uk/plat/memory.h).
     with open(opt.output, 'wb') as secobj:
         nsecs      = 0
-        last_pbase = 0
 
         cap = bootsec_size
         cap = cap - UKPLAT_BOOTINFO_SIZE
@@ -105,9 +104,6 @@ def main():
             if pbase < opt.min_address:
                 continue
 
-            if pbase != (pbase & ~(PAGE_SIZE - 1)):
-                raise Exception("Segment base address 0x{:x} is not page-aligned".format(pbase))
-
             flags = 0
             if phdr[2][0] == 'r':
                 flags |= UKPLAT_MEMRF_READ
@@ -123,8 +119,6 @@ def main():
             size = (int(phdr[1], base=16) + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1)
 
             assert nsecs < cap
-            assert pbase >= last_pbase
-            last_pbase = pbase
             nsecs += 1
 
             secobj.write(pbase.to_bytes(8, endianness)) # pbase