virtio-rng: fix excessive serialization with multiple consumers

Suppose N threads try to acquire a byte of entropy from an empty pool.  They
will all serialize on the mutex, waiting for the pool to refill.  However,
when the pool is eventually refilled, only one consumer will be awakened;
the rest will continue sleeping even though there is entropy available in the
pool.  They will eventually be awakened when the worker refills the pool,
but that's unneeded latency.

Fix by using wake_all() to wake all consumers.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
virtio-rng: fix incorrect use of valarray

std::valarray does not guarantee its elements will be allocated contiguously,
so the form &v[0] is only guaranteed to point to the first element, not the
rest.

Switch to std::vector, where contiguity is guaranteed.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
virtio-rng: drop excessive producer/consumer serialization

There is no need to hold the lock while waiting for the host to refill the
entropy buffer; drop it.

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