build.mk: aarch64: add --nomount to cmdline

don't try to mount zfs in our first simplified loader image.
Add comment about having to manually add the hello world program,
since there is no way to customize the loader image.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build.mk: aarch64: switch to image=uush as default

...until the build system confusion in modules/ is sorted out.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: fix exit notifiers mutual exclusion

As Pawel Dziepak noticed, the RCU protection for thread exit_notifiers
wasn't entirely safe, because we copied std::function objects under
the RCU lock, and that could cause allocations, and ultimately, sleeping.

So this patch replaces the RCU protection by that of a read-write lock
(rwlock). The code is greatly simplified, and the warnings against
deleting functions are gone. We now run the notifier functions inside
the rwlock's read lock, and they are allowed to sleep. Like the RCU
solution, several threads can complete in parallel.

Our existing rwlock's read-side is slower than the RCU read side - with a
roughly 50ns overhead; But a 50ns slowdown of thread exit is negligable,
and moreover, the old RCU-using code also included slow code like copying
the list, which is now unnecessary.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
musl: take alphasort and scandir from musl

Our copies were identical up to trivial changes in header files inclusion,
and the original musl version works too (we probably imported a slightly
newer version).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
core: make sched::cpu::current() out of line in DSOs

If it's in-line then DSO is accessing thread-local variables defined
in the kernel object which involves calling program::tls_addr() which
may block. However a lot of code assumes that current() does not
block. This was causing aborts in tst-unordered-ring-mpsc.

Fixes #447.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Revert "epoll: fix up lock ordering issues"

This reverts commit 4eb729eaa4a11d5fbb8b5f5d26209b5149097513. Fixes #448.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>