search for: virtio_cleanup

Displaying 20 results from an estimated 83 matches for "virtio_cleanup".

2014 Apr 25
1
[PATCH] virtio-rng: support multiple virtio-rng devices
...size); } if (!wait) return 0; - ret = wait_for_completion_killable(&have_data); + ret = wait_for_completion_killable(&vi->have_data); if (ret < 0) return ret; - busy = false; + vi->busy = false; - return data_avail; + return vi->data_avail; } static void virtio_cleanup(struct hwrng *rng) { - if (busy) - wait_for_completion(&have_data); -} - + struct virtrng_info *vi = (struct virtrng_info *)rng->priv; -static struct hwrng virtio_hwrng = { - .name = "virtio", - .cleanup = virtio_cleanup, - .read = virtio_read, -}; + if (vi->busy) + wait_...
2014 Apr 25
1
[PATCH] virtio-rng: support multiple virtio-rng devices
...size); } if (!wait) return 0; - ret = wait_for_completion_killable(&have_data); + ret = wait_for_completion_killable(&vi->have_data); if (ret < 0) return ret; - busy = false; + vi->busy = false; - return data_avail; + return vi->data_avail; } static void virtio_cleanup(struct hwrng *rng) { - if (busy) - wait_for_completion(&have_data); -} - + struct virtrng_info *vi = (struct virtrng_info *)rng->priv; -static struct hwrng virtio_hwrng = { - .name = "virtio", - .cleanup = virtio_cleanup, - .read = virtio_read, -}; + if (vi->busy) + wait_...
2014 Jul 02
6
[PATCH 0/2] hwrng: don't fetch data before device init
Hi, When booting a recent kernel under KVM with the virtio-rng device enabled, the boot process was stalling. Bisect pointed to a commit made during the 3.15 window to fetch randomness from newly-registered devices in the hwrng core. The details are in the patches. I considered a couple of approaches, but basing on the init() function being registered, as is done in patch 1 here, seems like
2014 Jul 02
6
[PATCH 0/2] hwrng: don't fetch data before device init
Hi, When booting a recent kernel under KVM with the virtio-rng device enabled, the boot process was stalling. Bisect pointed to a commit made during the 3.15 window to fetch randomness from newly-registered devices in the hwrng core. The details are in the patches. I considered a couple of approaches, but basing on the init() function being registered, as is done in patch 1 here, seems like
2020 Aug 11
3
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...tion_killable(&vi->have_data); > @@ -74,7 +74,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > > vi->busy = false; > > - return vi->data_avail; > + return min_t(size_t, size, vi->data_avail); > } > > static void virtio_cleanup(struct hwrng *rng) > Reviewed-by: Laurent Vivier <lvivier at redhat.com>
2020 Aug 11
3
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...tion_killable(&vi->have_data); > @@ -74,7 +74,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > > vi->busy = false; > > - return vi->data_avail; > + return min_t(size_t, size, vi->data_avail); > } > > static void virtio_cleanup(struct hwrng *rng) > Reviewed-by: Laurent Vivier <lvivier at redhat.com>
2009 Jun 18
0
[PATCHv5 09/13] qemu: virtio support for many interrupt vectors
...]); } + if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +657,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 18
0
[PATCHv5 09/13] qemu: virtio support for many interrupt vectors
...]); } + if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +657,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 10
0
[PATCHv4 09/13] qemu: virtio support for many interrupt vectors
...]); } + if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +657,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 10
0
[PATCHv4 09/13] qemu: virtio support for many interrupt vectors
...]); } + if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +657,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 21
0
[PATCHv6 07/12] qemu/virtio: virtio support for many interrupt vectors
...]); } + if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +657,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 21
0
[PATCHv6 07/12] qemu/virtio: virtio support for many interrupt vectors
...]); } + if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +657,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 May 25
0
[PATCH 09/11] qemu: virtio support for many interrupt vectors
...+ if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); + return 0; } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +659,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 02
0
[PATCHv2 09/13] qemu: virtio support for many interrupt vectors
...+ if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); + return 0; } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +659,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 05
0
[PATCHv3 09/13] qemu: virtio support for many interrupt vectors
...+ if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); + return 0; } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +659,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 May 25
0
[PATCH 09/11] qemu: virtio support for many interrupt vectors
...+ if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); + return 0; } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +659,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 02
0
[PATCHv2 09/13] qemu: virtio support for many interrupt vectors
...+ if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); + return 0; } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +659,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2009 Jun 05
0
[PATCHv3 09/13] qemu: virtio support for many interrupt vectors
...+ if (vdev->nvectors) { + qemu_get_be16s(f, &vdev->vq[i].vector); + //msix_vector_use(&vdev->pci_dev, vdev->config_vector); + } } - virtio_update_irq(vdev); + virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); + return 0; } void virtio_cleanup(VirtIODevice *vdev) @@ -627,6 +659,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id, vdev->status = 0; vdev->isr = 0; vdev->queue_sel = 0; + vdev->config_vector = VIRTIO_NO_VECTOR; vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI...
2014 Aug 12
0
[PATCH v2 1/1] virtio: rng: add derating factor for use by hwrng core
...nsertion(+) diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 0027137..2e3139e 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c @@ -116,6 +116,7 @@ static int probe_common(struct virtio_device *vdev) .cleanup = virtio_cleanup, .priv = (unsigned long)vi, .name = vi->name, + .quality = 1000, }; vdev->priv = vi; -- 1.9.3
2014 Aug 15
1
[PULL] virtio-rng: add derating factor for use by hwrng core
Hi Linus, Sending directly to you with the commit log changes Ted Ts'o pointed out. Not sure if Rusty's back after his travel, but this already has his s-o-b. Please pull. The following changes since commit c9d26423e56ce1ab4d786f92aebecf859d419293: Merge tag 'pm+acpi-3.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm (2014-08-14 18:13:46 -0600) are