sched: ignore backward jumps in clock

Due to an unknown bug (bug in our HPET driver?), OSv crashed on our build
machine with an assertion that the clock only goes foward. The clock
jumping backward is a bad sign, but it's not really necessary to crash the
VM when it happens, assuming it only happens rarely. This patch makes the
scheduler handle time<0 just like time==0.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
virtio: Fix device init with no MSI support

Not all virtio devices support MSI.  Fix device initialization by not
writing to VIRTIO_MSI_QUEUE_VECTOR register if a PCI device does not
advertise MSI-X support.  This is needed to initialize virtio-rng
devices when running on KVM/QEMU.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
virtio: Add virtio-rng driver

This adds the virtio-rng driver to OSv.  The implementation is simple:

  - Create device nodes for "/dev/random" and "/dev/urandom" that both
    use the same virtio_rng_read() hook.

  - Ask the host for random bytes on virtio_rng_read(), wait on a
    condition variable that is woken up by GSI interrupt handler for the
    virtio-rng PCI device.

We eventually should move device node creation to separate
drivers/random.c that multiplexes between different hardware RNG
implementations.  However, as we only support virtio-rng, I'm leaving
that to whomever implements support for the next RNG.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: tst-random.so

Add a simple test case for "/dev/random" which just reads from the file
and prints out the random bytes.

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