java: fix indentation issues
java: remove redundant local variable
java: make 'java' module depend on 'fonts'

Reduces duplication.
java: add copyright banner to usr.manifest
java: do not print uncaught exception form the child context on the console

The parent context which is doing join() prints it anyway so we end up
with duplication. Also, currently when running java tests which expect
contexts to fail the output is polluted with stack traces which do not
denote failures.
tests: detect ContextFailedException as a failure pattern
java: make runjava.jar domain all-privileged

When application installed a SecurityManager, child protection domains
would have been declined the right to read files from their jar. This
was making apache derby fail with this:

java.util.MissingResourceException: Can't find bundle for base name org.apache.derby.loc.drda.messages, locale en
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:795)
	at org.apache.derby.iapi.tools.i18n.LocalizedResource.setResource(LocalizedResource.java:184)
	at org.apache.derby.iapi.tools.i18n.LocalizedResource.getTextMessage(LocalizedResource.java:311)
	at org.apache.derby.iapi.tools.i18n.LocalizedResource.getTextMessage(LocalizedResource.java:273)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.localizeMessage(NetworkServerControlImpl.java:3536)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.localizeMessage(NetworkServerControlImpl.java:3492)
	at org.apache.derby.drda.NetworkServerControl.installSecurityManager(NetworkServerControl.java:705)

The bundle actually exists and resides in derbynet.jar but since we
have a SecurityManager installed and runjava.jar domain, which is a
parent of derbynet.jar, does not have permissions for reading other
jars than itself we fail on permission check inside the class
loader. When the same code is run on the host it passes the check
because derbynet.jar is invoked directly from an all-privileged
context. I think the solution is to make our runjava.jar
all-privileged by default. One way to do that is to grant the
permissions explicitly in the java.policy file, or put runjava.jar in
the extensions directory (/usr/lib/jvm/jre/lib/ext). The latter is
simpler so I went with that approach.
tests: add test exploiting issue with protection domain permissions
java: grant exitVM permission to isolates by default

The OpenJDK's launcher does this, if we want to behave the same we also should do this.
tests: add test for exitVM permission under presence of SecurityManager
vfs: Fix isatty on console file descriptors

file descriptors 0, 1 and 2 aren't vfs files,
thus isatty cannot rely on a vnode to determine
whether or not the device underlying the file
is tty.

Avi suggested adding a new file subclass and using
dynamic_cast to avoid introcucing a new file type
to specifically address this problem.

According to Gilad, this bug was preventing lua
from starting in interactive mode.

Reported-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
README: add description about building for Arch user

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
console: do not capture local variables by reference

I am seeing intermittent crashes while running "make check" that appears
to come from serial input initialization. I and Nadav reviewed relevant
code and found two places where local (on stack) variable is captured by
refference by lambda expression. The patch fixes both of the. In on of the
cases lambda is not needed at all. This seam to be fixing the crash.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
kmem_cache: do not ignore alignment requirements

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
zfs: align zio buffers to a page boundary

Since ARC buffers are used directly as a read page cache they have to be
aligned to a page boundary.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
mempool: introduce page memory allocator

This allocator is meant for objects to large for mempools but still fitting
inside one page. In such case no additional metadata needs to be stored.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
mempool: make large memory allocator less wasteful

If the requested alignment is smaller than a page the header and the
begining of the allocated block can be in the same page, which can
save some memory.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
trace: remove use of global state in fetch_and_inc_if_less()

The function was accessing _active_cpus when it should actually access
input variable 'var'.

Reported-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
libc: add getgrnam_r for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: move getgrnam from runtime.cc

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>