early-console: implement arch independent early console

includes an implementation of arch_early_console for x64
using isa-serial, and an implementation for aarch64
using the (for now write-only) pl011.

This restores output functionality for AArch64 lost in
commit 9bbbe9dc.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: prepare read uio in get_arcbuf()

It was accidentally changed to "write" by 4658e56364a6a31b197e0.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: remove unnecessary vcount() checks in rename()

Elevated vnode reference count should not prevent rename() from working.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
pagecache: save vnode pointer instead of dentry in write page cache

dentry object represents a directory, vnode represent a file, so it is
better to use vnode in the page cache.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
mmu: do not destroy pt roots with double initialization

the class construction of the page_table_root must happen
before priority "mempool", or all the work in arch-setup
will be destroyed by the class constructor.
Problem noticed while working on the page fault handler for AArch64.

Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
aarch64: gic: implement GICv2

implement simple GIC class for interacting with
the GIC distributor and CPU interface.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
trace: introduce trace.py prof-lock command

The command shows a profile with amount of time threads were blocked
on a mutex. This can be used to estimate lock contention.

To use the profile the 'mutex_lock_wa*' tracepoints need to be enabled
with backtrace.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: fix symbol resolving for addr2line v2.23

The script did not parse the response properly in case the symbol is
unknown. That version of addr2line responds in two lines:

 ??
 ??:0

but the script was assuming one line ?? ??:0, as returned by addr2line v2.24

Reported-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: LOCK() and UNLOCK() do not have to return a value

The return values of LOCK() and UNLOCK() are never used. Besides, in the
current Musl version these macros do not have return values at all.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
timerfd: Add nsec validity check to timerfd_settime

According to the manual page, the nsec field from both it_value
and it_interval must be checked, if wrong, return EINVAL.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build.mk: remove --vga from cmdline on osv.vmdk/.vdi

Now we enabled both VGA and serial, we nolonger need to add --vga cmdline for VMW/VBox.

Reviewed-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
net: cleanup syncache_head construction

This change moves syncache_head construction to its constructor so that the
timer can be nicely embedded in the structure.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vmxnet3: support net channel on vmxnet3.

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