runjava.jar: build jar using ant

Building with ant requires no changes in the build scripts
when new classes are added. It is a standrd tool to build
java programs.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
RunJava: system class loader should contain application resources

The system classloader should have classes which were
specified in the command line using -cp/-classpath/-jar.
Before this change only runjava.jar was included.

System class loader is queried explicitly by
java.util.logging framework to lookup classes
configred in logging properties file.

To solve this problem a custom system classloader
is set when starting JVM. It delegates to the application
classloader created when java program was started.

It also handles the case when a new java application
is started within the same JVM. Such application
should have its own view of system classes. However
we are able to install only one system classloader
per JVm. To solve this we start each java application
in a separate thread and use InheritableThreadLocal
to hold the application class loader which should be
used as system class loader view for the thread family.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
runjava: move runjava.jar code to a separate directory

Related changes previously made in java/build.xml
were reverted and moved to java/runjava/build.xml

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
runjava: Set source level to 1.7

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
mmu: optimize searching for vmas

Currently we search the entire vma list while looking for a range.  This
is less than optimal.

Define a vma::addr_compare function object that can be used as comparator
with boost::rbtree::equal_range(), and use that to search for both bounds
simultaneously.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
mmu: VMA permission flags

Add permission flags to VMAs. They will be used by mprotect() and the
page fault handler.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: Anonymous memory demand paging

Switch to demand paging for anonymous virtual memory.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-mmap.so: mincore() tests for demand paging

As suggested by Nadav, add tests for mincore() interraction with demand
paging.

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