Simon Kuenzer [Fri, 7 Feb 2020 14:36:33 +0000 (15:36 +0100)]
Use uk_posix_memalign() for stack allocation
Recent changes in Unikraft modified uk_palloc()'s signature and
guarantees: allocation sizes are given with the number of pages and
the returned memory is not necessarily aligned to the size.
By using uk_posix_memalign() we restore our assumptions in the code.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Update libcalls.go to decrease the number of stubs needed. This patch
removes wrappers for system calls that are not used from libgo and
that are not yet implemented on Unikraft.
Signed-off-by: Charalampos Mainas <Charalampos.Mainas@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
libgo uses backtracking but it leads to page faults. For the time being
it is disabled but it should be revisited in the future.
The second patch decreases the amount of memory maps because it was
exceeding 1G.
Finally, Go uses context switching to manage goroutines. This patch
adds some changes to the way contexts are handled so they can be
compatible with threading in Unikraft.
Signed-off-by: Charalampos Mainas <Charalampos.Mainas@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
libgo expects the unwind.h header although it comes with its own
header, unwind-generic.h, so we will be using that one instead. The
second patch removes an unnecessary include directive.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
The file packages.uk file was generated by capturing the building
commands from the output of the original libgo build. This patch also
adds the generated .go files needed for building the packages.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>