sched: change default timeslice length

This patch changes the "thyst" (hysteresis time) scheduler paramter from
2ms to 5ms.

It can be shown that when when two CPU-hog threads compete they alternate
running in timeslices of length 2*thyst. I.e., after this patch the time
slice in that case will be 10ms, exactly as happens in Linux (as was
measured by tests/misc-timeslice.cc).

thyst also caps the number of preemption-timer setting operations (which
require slow APIC exits) to 1/thyst - i.e., 200 a second.

Please note that the ideal time slice defined by thyst is rarely achieved
in practice, as waking a low-runtime thread can cause a context switch
long before the full time slice was used. For example, network I/O handling
threads are often woken many thousands of times a second; As another example,
our "page access scanner" thread wakes up (on one CPU) every 1ms and runs
for a very short duration, after which a rescheduling occurs, so in the
above example we will switch between the two CPU-hugging thread every 1ms,
instead of every 5ms.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
bio: Switch to use mutex_t and waitqueue

Simplfy the code a bit by switching from pthread_mutex_t and
pthread_cond_t to mutex_t and waitqueue.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
aarch64: add, build libfdt

we need to use libfdt at the moment to pass the information
about the hardware to the guest, because the implementation
of ACPI for the guest seems to be a major effort that will
not happen very quickly. Also contains an one liner to
fix an ARCH use (arch should be used internally).

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>