aarch64: entry.S: show exception vector entries in backtraces

by marking as @function we get them to show up in the backtrace.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
aarch64: arch-switch: implement thread::switch_to

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
aarch64: mmu: fix page_fault assert for daif_i

In AArch64 the I-bit set in DAIF means "interrupts disabled".
Therefore, the assertion check must be inverted in page_fault.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: use seconds as the default unit of timestamp

trace.py allows to slice samples to a time range using --since,
--until and --period. Currently the default unit for timestamps was
nanoseconds. However the timestamp pretty much always comes from the
'trace list' output, which displays timestamp in seconds with a dot
separating the nanosecond precision part. That required explicit unit
designating by appending 's' suffix to the timestamp when passing to
--since and --until to

This change makes --since and --until use seconds as a default unit,
so that the timestamp copied from trace list can be used without any
change, eg:

 $ scripts/trace.py --since 1400607382.775557041

Default unit of --period (nanoseconds) remains unchanged.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
apps: update to latest

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
virtio::net::txq: Fix the bug causing the false asserts

vec_sz in net::txq::try_xmit_one_locked(net_req*) should be initialized to 1 and not to 0
since there is always net_hdr element and vec_sz is incremented only for fragments not taking
into an account the header element.

This miscalculation caused vqueue->add_buf() return false while vqueue->avail_ring_has_room(vec_sz)
was returning true when the amount of elements in the avail ring was equal to vec_sz
since the actual size of the _sg_vec was "vec_sz + 1".

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
mmu: fix split_large_page()

Currently the code overwrites large pte with a pointer to intermediate
page before populating intermediate page's ptes with correct values. It
happen to work with EPT since TLB is still valid, but without EPT this
is not the case.

Fixes #316.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
acpi: Fix early-ACPI partial linear map

When running on a KVM host without EPT, OSv used to crash if ran 1GB
or less memory. The crash was in early acpi initialization, which called
AcpiOsMapMemory, which called linear_map() on the small chunk of physical
memory requested by ACPI.

It turns out that the chunk requested was just 4096 bytes, which caused
our linear_map() implementation to break down a huge-page into small-pages.
This didn't work - I'm don't know yet what exactly is the bug or why it
only shows up when the host doesn't use EPT, or if the memory is smaller
than 1GB...

But in any case, since we know our complete linear map always uses huge
pages, I think it makes no sense to map a single small page, and we can
just map a whole huge page. This will cause linear_map() not to try to
break up any huge pages, and this bug goes away.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>