virtio: An entropy device, as suggested by hpa.

Note that by itself, having a "hardware" random generator does very
little: you should probably run "rngd" in your guest to feed this into
the kernel entropy pool.

Included:
	virtio_rng: dont use vmalloced addresses for virtio

	If virtio_rng is build as a module, random_data is an address
	in vmalloc space. As virtio expects guest real addresses, this
	can cause any kind of funny behaviour, so lets allocate
	random_data dynamically with kmalloc.

	Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2008-05-30 15:09:44 -05:00
parent 3ef5360954
commit f7f510ec19
4 changed files with 173 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#ifndef _LINUX_VIRTIO_RNG_H
#define _LINUX_VIRTIO_RNG_H
#include <linux/virtio_config.h>
/* The ID for virtio_rng */
#define VIRTIO_ID_RNG 4
#endif /* _LINUX_VIRTIO_RNG_H */