All memory region descriptors must be aligned. Therefore, ensure
that the initrd and command-line related memory regions inserted
when booting through the Linux Boot Protocol are also aligned.
Note: If these two are aligned, all the other memory regions reported
through the boot protocol should be already aligned. Thus, we do not
do this explicit alignment on the free memory regions, as they must
have been already aligned by the previous boot phase. If this is not
the case, then the issue lies in the entity that booted us.
Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1057
mrd.pbase = cmdline_addr;
mrd.vbase = cmdline_addr;
- mrd.len = cmdline_size;
+ mrd.len = PAGE_ALIGN_UP(cmdline_size);
mrd.type = UKPLAT_MEMRT_CMDLINE;
mrd.flags = UKPLAT_MEMRF_READ | UKPLAT_MEMRF_MAP;
#ifdef CONFIG_UKPLAT_MEMRNAME
mrd.flags = UKPLAT_MEMRF_MAP | UKPLAT_MEMRF_READ;
mrd.vbase = initrd_addr;
mrd.pbase = initrd_addr;
- mrd.len = initrd_size;
+ mrd.len = PAGE_ALIGN_UP(initrd_size);
#ifdef CONFIG_UKPLAT_MEMRNAME
memcpy(mrd.name, "initrd", sizeof("initrd"));
#endif /* CONFIG_UKPLAT_MEMRNAME */