bsd/aarch64: clean-up atomics

CBNZ instruction doesn't affect condition flags, so there is no sense to
clobber them.

Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
arch/aarch64: fix storage size for fpsr and fpcr

FPSR and FPCR registers are 32-bit wide.

Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: Add inotify stubs

This patch adds inotify API stubs. The lack of inotify prevents booting
an application under OSv completely.

  https://github.com/cloudius-systems/capstan/issues/65

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
build: Fix Revert "build: Skip rebuild of usr.img on osv.vmdk and osv.vdi target"

1) Adding usr.img dependency to Makefile is broken because no usr.img
target is in Makefile. (It happened to work for me because I have a
file named usr.img under src/osv)

2) Adding usr.img dependency to build.mk will cause the rebuild of usr.img for some reason.

	osv.vmdk osv.vdi: usr.img
		...
	.PHONY: osv.vmdk osv.vdi

So, in order to build correct images. Let's drop the usr.img dependency
completely for now before we can fix issue 2).

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build.mk: build arm-clock stub

forgot to build the arm-clock stub, which will cause
a NULL pointer dereference when we turn the mmu on.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
mmu: remove overloaded align_up and align_down

align.hh functions with the name name can be used instead
without any downside, and with the upside of less confusion.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
exceptions: add accessors for pc and error

in order to share most of the fault code in core/mmu.cc,
we add accessors to get the program counter and an error
code whose interpretation is arch-dependent
(error_code for x64, ESR for AArch64).

This also fixes an issue in jvm_balloon, where the
error code was checked incorrectly.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: create initial page tables

create the initial page tables for TTBR0 / TTBR1
and set up the registers for the MMU.

Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
MMU: add flush_tlb_local and flush_tlb_all

add the APIs to flush a single processor tlb or all
tlbs in the cluster.

Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
mmu: implement mmu for aarch64 with refactoring of x64

Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: remove most AARCH64_PORT_STUB related to MMU

also enable core/pagecache.cc in the AArch64 build.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>