--- sys/dev/virtio/random/virtio_random.c.orig 2022-02-04 20:36:41.288163000 +0000 +++ sys/dev/virtio/random/virtio_random.c 2022-03-11 00:47:55.303250000 +0000 @@ -223,6 +223,8 @@ vtrnd_alloc_virtqueue(struct vtrnd_softc *sc) return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info)); } +extern int rebooting; + static int vtrnd_harvest(struct vtrnd_softc *sc, void *buf, size_t *sz) { @@ -232,6 +234,9 @@ vtrnd_harvest(struct vtrnd_softc *sc, void *buf, size_ uint32_t value[HARVESTSIZE] __aligned(sizeof(uint32_t) * HARVESTSIZE); uint32_t rdlen; int error; + + if (rebooting) + return (EDEADLK); _Static_assert(sizeof(value) < PAGE_SIZE, "sglist assumption");