java: Add helper class to create Json like list

This helper class is used when it is needed to create an array or an
object in a Json like format.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Java Json generator: Add a Helper class for JSON generator

The JavaInfo class retrieve information from the java and pass it to the
C++.  Some of the information is in a json format.

This helper class add some static method to create JSON formatted
string.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
java: JavaInfo Garbage collection information

This is a helper class to holds the garbage collection information, it
simplified getting the data in the c++ side.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
java: Adding the JavaIno class

The JavaInfo simplify getting information from the java and return it
via the JNI to the API.

It sets a simple front end for the internal java information.

Currently it support get and set mbean information, get the garbage
collection information and system properties.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
java: add an interface for the java from the api

The API requires to retrieve and modify information in the jvm. To
simplify this the java_api is used as a C++ front-end to the java, it is
backed up by a java class (JavaInfo) that acts as a front-end of the
java.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
java: set the JavaVM in the java_api

The java_api used by the API uses JNI to connect to the running jvm. It
needs the JavaVM pointer to get be able to connect to the JVM.

The JavaVM is been set after the jvm is created.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
build.mk: Add the java_api to the compilation and packaging

The java_api.cc is a helper class that the API use to get information
from the java. It need to be compiled and added to the image.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
drivers: Make block device init silent by default

We now print disk probe information like:

virtio-scsi: Add scsi device target=1, lun=0   as vblk0, devsize=10842275840

Disable it by default. The --verbose option will make this info
available which is useful when debug.

Reported-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add scandir() from musl

Add missing scandir() function from musl 1.0.0. Fixes #237.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
ahci: Limit max size of a bio request

One PRDT entry can contain 4MB buffer at most, we currently only use one
PRDT per AHCI cmd. Limit the size of a bio request to respect it. Larger
bio will be split into smaller bios by multiplex_strategy.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
ahci: Align cmd_table tables to 128-byte address

AHCI spec '4.2.2 Command List Structure' says 'Command Table Descriptor
Base Address' must be aligned to 128-byte cache line, indicated by bits
06:00 being reserved.

All the 32 cmd_table are allocated in one linear space. The size of
cmd_table is 144 bytes for now which is larger than 128 bytes. So we pad
cmd_table to 256 byes.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
ahci: Assert data buffer address

Assert to make sure the data buffer address satisfies the AHCI spec's data
alignment requirement.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
ahci: Use all the cmd slots

AHCI has 32 cmd slots to issue cmd. Only first slot is used currently
which makes the queue-depth 1.

This patch uses all the cmd slots and makes the cmd completion async.
Now, the queue-depth is 32.

Test with "/tests/misc-bdev-write.so" on VBOX shows improvements:

   Before: ~10MB/s
   After: ~20MB/s

1000 round of "/tests/misc-bdev-rw.so" tests passed on VBOX and QEMU.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: Add assert to capture rescheduling attempt in nested exception

Rescheduling in nested exception is not supported since nested exception
stack is per cpu, but without the assert such reschedule will cause
stack corruption which will be hard to debug.

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>
mempool: Contiguous physical memory holder class

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
[ penberg: fix formatting ]
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add vmxnet3 driver

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add vmxnet3 argument on run.py

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Support VMDK and VDI format

Add osv.vmdk and osv.vdi targets on Makefile.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts/gen-vbox-ova.sh: Add --vga option to vdi image

Generate osv.vdi image from 'make osv.vdi' Makefile target which will
convert to the image to vdi as well as add the --vga option.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
networking: remove double socket unlock

sogeneric_send(), in one error case, unlocks the socket before doing
'goto release' which unlocks the socket again, resulting in an assertion
failure (unlocking an unlocked mutex) and crash.

This patch removes the extra unlock.

Fixes #248.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>