freebsd-nq/sys/dev/virtio
Conrad Meyer ad5979f7da virtio_random(4): Fix random(4) integration
random(4) masks unregistered entropy sources.  Prior to this revision,
virtio_random(4) did not correctly register a random_source and did not
function as a source of entropy.

Random source registration for loadable pure sources requires registering a
poll callback, which is invoked periodically by random(4)'s harvestq
kthread.  The periodic poll makes virtio_random(4)'s periodic entropy
collection redundant, so this revision removes the callout.

The current random source API is somewhat limiting, so simply fail to attach
any virtio_random devices if one is already registered as a source.  This
scenario is expected to be uncommon.

While here, handle the possibility of short reads from the hypervisor random
device gracefully / correctly.  It is not clear why a hypervisor would
return a short read or if it is allowed by spec, but we may as well handle
it.

Reviewed by:	bryanv (earlier version), markm
Security:	yes (note: many other "pure" random sources remain broken)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20419
2019-06-04 00:01:37 +00:00
..
balloon
block
console Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
mmio Split out the virtio mmio FDT attachment and add an ACPI attachment. 2018-10-21 15:43:20 +00:00
network Remove non-functional SCTP checksum offload support for virtio. 2019-05-07 20:28:12 +00:00
pci virtio_pci(4): Fix typo in read_ivar method 2019-05-25 01:59:24 +00:00
random virtio_random(4): Fix random(4) integration 2019-06-04 00:01:37 +00:00
scsi Fix SCSI sense data pass through. 2019-04-12 18:54:09 +00:00
virtio_bus_if.m Add VirtIO bus config_generation method 2018-02-19 19:28:24 +00:00
virtio_config.h Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers 2018-06-17 20:45:48 +00:00
virtio_ids.h Sync VirtIO IDs with Linux 2018-01-14 06:03:40 +00:00
virtio_if.m
virtio_ring.h Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers 2018-06-17 20:45:48 +00:00
virtio.c Add VirtIO bus config_generation method 2018-02-19 19:28:24 +00:00
virtio.h Add VirtIO bus config_generation method 2018-02-19 19:28:24 +00:00
virtqueue.c Add more virtqueue getter methods 2018-02-19 19:31:18 +00:00
virtqueue.h Add more virtqueue getter methods 2018-02-19 19:31:18 +00:00