search for: random_recv_done

Displaying 20 results from an estimated 62 matches for "random_recv_done".

2014 Apr 25
1
[PATCH] virtio-rng: support multiple virtio-rng devices
...ct virtqueue *vq; -static unsigned int data_avail; -static DECLARE_COMPLETION(have_data); -static bool busy; + +struct virtrng_info { + struct virtio_device *vdev; + struct hwrng hwrng; + struct virtqueue *vq; + unsigned int data_avail; + struct completion have_data; + bool busy; +}; static void random_recv_done(struct virtqueue *vq) { + struct virtrng_info *vi = vq->vdev->priv; + /* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */ - if (!virtqueue_get_buf(vq, &data_avail)) + if (!virtqueue_get_buf(vi->vq, &vi->data_avail)) return; - complete(&have_data); + c...
2014 Apr 25
1
[PATCH] virtio-rng: support multiple virtio-rng devices
...ct virtqueue *vq; -static unsigned int data_avail; -static DECLARE_COMPLETION(have_data); -static bool busy; + +struct virtrng_info { + struct virtio_device *vdev; + struct hwrng hwrng; + struct virtqueue *vq; + unsigned int data_avail; + struct completion have_data; + bool busy; +}; static void random_recv_done(struct virtqueue *vq) { + struct virtrng_info *vi = vq->vdev->priv; + /* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */ - if (!virtqueue_get_buf(vq, &data_avail)) + if (!virtqueue_get_buf(vi->vq, &vi->data_avail)) return; - complete(&have_data); + c...
2008 Jan 14
1
[PATCH] virtio_rng: adopt driver to newest virtio code
...ar/hw_random/virtio-rng.c =================================================================== --- kvm.orig/drivers/char/hw_random/virtio-rng.c +++ kvm/drivers/char/hw_random/virtio-rng.c @@ -27,13 +27,12 @@ static struct virtqueue *vq; static u32 random_data; static bool have_data; -static bool random_recv_done(struct virtqueue *vq) +static void random_recv_done(struct virtqueue *vq) { have_data = true; - /* Don't suppress callbacks: there can't be any more since we + /* No need to call disable_cb: there can't be any more since we * have used up the only buffer. */ - return true; }...
2008 Jan 14
1
[PATCH] virtio_rng: adopt driver to newest virtio code
...ar/hw_random/virtio-rng.c =================================================================== --- kvm.orig/drivers/char/hw_random/virtio-rng.c +++ kvm/drivers/char/hw_random/virtio-rng.c @@ -27,13 +27,12 @@ static struct virtqueue *vq; static u32 random_data; static bool have_data; -static bool random_recv_done(struct virtqueue *vq) +static void random_recv_done(struct virtqueue *vq) { have_data = true; - /* Don't suppress callbacks: there can't be any more since we + /* No need to call disable_cb: there can't be any more since we * have used up the only buffer. */ - return true; }...
2023 Jan 20
0
[PATCH 1/2] virtio-rng: implement entropy leak feature
...t; + add_fill_on_leak_request(vi, activeq, vi->leak_data, sizeof(vi->leak_data)); > + kick_activeq = true; > + } > + } > + > + if (kick_activeq) > + virtqueue_kick(activeq); > + > + spin_unlock_irqrestore(&vi->lock, flags); > +} > + > static void random_recv_done(struct virtqueue *vq) > { > struct virtrng_info *vi = vq->vdev->priv; > + unsigned long flags; > > + spin_lock_irqsave(&vi->lock, flags); > /* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */ > if (!virtqueue_get_buf(vi->vq, &vi->...
2014 Jul 21
4
[PATCH 0/3] virtio-rng: contribute to early randomness requests
Hi, This series enables virtio-rng to service the early randomness requests made by the hwrng core (patch 2), with Herbert's idea of using the scan routine. Patch 3 reverts the previous restriction, which no longer applies, to not send read requests to the host before successful probe. Patch 1 is a minor cleanup. Please review and apply, Amit Shah (3): virtio: rng: remove unused struct
2014 Jul 21
4
[PATCH 0/3] virtio-rng: contribute to early randomness requests
Hi, This series enables virtio-rng to service the early randomness requests made by the hwrng core (patch 2), with Herbert's idea of using the scan routine. Patch 3 reverts the previous restriction, which no longer applies, to not send read requests to the host before successful probe. Patch 1 is a minor cleanup. Please review and apply, Amit Shah (3): virtio: rng: remove unused struct
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 2/13] [Mostly resend] virtio additions
...lude <linux/err.h> +#include <linux/hw_random.h> +#include <linux/scatterlist.h> +#include <linux/spinlock.h> +#include <linux/virtio.h> +#include <linux/virtio_rng.h> + +static struct virtqueue *vq; +static u32 random_data; +static bool have_data; + +static bool random_recv_done(struct virtqueue *vq) +{ + have_data = true; + + /* Don't suppress callbacks: there can't be any more since we + * have used up the only buffer. */ + return true; +} + +static void register_buffer(void) +{ + struct scatterlist sg; + + sg_init_one(&sg, &random_data...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 2/13] [Mostly resend] virtio additions
...lude <linux/err.h> +#include <linux/hw_random.h> +#include <linux/scatterlist.h> +#include <linux/spinlock.h> +#include <linux/virtio.h> +#include <linux/virtio_rng.h> + +static struct virtqueue *vq; +static u32 random_data; +static bool have_data; + +static bool random_recv_done(struct virtqueue *vq) +{ + have_data = true; + + /* Don't suppress callbacks: there can't be any more since we + * have used up the only buffer. */ + return true; +} + +static void register_buffer(void) +{ + struct scatterlist sg; + + sg_init_one(&sg, &random_data...
2014 Jul 05
6
[PATCH v2 0/2] hwrng, virtio-rng: init-time fixes
v2: - this now separates both the patches; the virtio-rng fix is self-contained - re-work hwrng core to fetch randomness at device init time if ->init() is registered by the device, instead of not calling it at all. - virtio-rng: introduce a probe_done bool to ensure we don't ask host for data before successful probe Hi, When booting a recent kernel under KVM with the virtio-rng
2014 Jul 05
6
[PATCH v2 0/2] hwrng, virtio-rng: init-time fixes
v2: - this now separates both the patches; the virtio-rng fix is self-contained - re-work hwrng core to fetch randomness at device init time if ->init() is registered by the device, instead of not calling it at all. - virtio-rng: introduce a probe_done bool to ensure we don't ask host for data before successful probe Hi, When booting a recent kernel under KVM with the virtio-rng
2012 Aug 28
3
[PATCH v2 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...tic struct virtqueue *vq; static unsigned int data_avail; static DECLARE_COMPLETION(have_data); @@ -93,6 +96,7 @@ static int probe_common(struct virtio_device *vdev) int err; /* We expect a single virtqueue. */ + vdev->indirect_thresh = indirect_thresh; vq = virtio_find_single_vq(vdev, random_recv_done, "input"); if (IS_ERR(vq)) return PTR_ERR(vq); diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index e88f843..fc14e7f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -39,6 +39,9 @@ #include <linux/module.h> #include...
2012 Aug 28
3
[PATCH v2 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...tic struct virtqueue *vq; static unsigned int data_avail; static DECLARE_COMPLETION(have_data); @@ -93,6 +96,7 @@ static int probe_common(struct virtio_device *vdev) int err; /* We expect a single virtqueue. */ + vdev->indirect_thresh = indirect_thresh; vq = virtio_find_single_vq(vdev, random_recv_done, "input"); if (IS_ERR(vq)) return PTR_ERR(vq); diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index e88f843..fc14e7f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -39,6 +39,9 @@ #include <linux/module.h> #include...
2012 Jun 18
2
[RFC 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...ic struct virtqueue *vq; static unsigned int data_avail; static DECLARE_COMPLETION(have_data); @@ -90,6 +93,7 @@ static int virtrng_probe(struct virtio_device *vdev) int err; /* We expect a single virtqueue. */ + vdev->indirect_thresh = indirect_thresh; vq = virtio_find_single_vq(vdev, random_recv_done, "input"); if (IS_ERR(vq)) return PTR_ERR(vq); diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index cdf2f54..60397a4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -37,6 +37,9 @@ #include <linux/module.h> #include...
2012 Jun 18
2
[RFC 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...ic struct virtqueue *vq; static unsigned int data_avail; static DECLARE_COMPLETION(have_data); @@ -90,6 +93,7 @@ static int virtrng_probe(struct virtio_device *vdev) int err; /* We expect a single virtqueue. */ + vdev->indirect_thresh = indirect_thresh; vq = virtio_find_single_vq(vdev, random_recv_done, "input"); if (IS_ERR(vq)) return PTR_ERR(vq); diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index cdf2f54..60397a4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -37,6 +37,9 @@ #include <linux/module.h> #include...
2012 Aug 30
2
[PATCH v3 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...tic struct virtqueue *vq; static unsigned int data_avail; static DECLARE_COMPLETION(have_data); @@ -93,6 +96,7 @@ static int probe_common(struct virtio_device *vdev) int err; /* We expect a single virtqueue. */ + vdev->indirect_thresh = indirect_thresh; vq = virtio_find_single_vq(vdev, random_recv_done, "input"); if (IS_ERR(vq)) return PTR_ERR(vq); diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index e88f843..da2e44c 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -39,6 +39,9 @@ #include <linux/module.h> #include...
2012 Aug 30
2
[PATCH v3 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...tic struct virtqueue *vq; static unsigned int data_avail; static DECLARE_COMPLETION(have_data); @@ -93,6 +96,7 @@ static int probe_common(struct virtio_device *vdev) int err; /* We expect a single virtqueue. */ + vdev->indirect_thresh = indirect_thresh; vq = virtio_find_single_vq(vdev, random_recv_done, "input"); if (IS_ERR(vq)) return PTR_ERR(vq); diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index e88f843..da2e44c 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -39,6 +39,9 @@ #include <linux/module.h> #include...
2008 Jan 14
1
[PATCH] fix bug in virtio-rng
...+ 1 file changed, 3 insertions(+) Index: kvm/drivers/char/hw_random/virtio-rng.c =================================================================== --- kvm.orig/drivers/char/hw_random/virtio-rng.c +++ kvm/drivers/char/hw_random/virtio-rng.c @@ -29,6 +29,9 @@ static bool have_data; static void random_recv_done(struct virtqueue *vq) { + int len = 0; + vq->vq_ops->get_buf(vq, &len); + BUG_ON(!len); have_data = true; /* No need to call disable_cb: there can't be any more since we -- IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Gesch?ftsf?hrung: Herbert...
2009 Apr 23
1
[PATCH] virtio-rng: Remove false BUG for spurious callbacks
...e changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6/drivers/char/hw_random/virtio-rng.c =================================================================== --- linux-2.6.orig/drivers/char/hw_random/virtio-rng.c +++ linux-2.6/drivers/char/hw_random/virtio-rng.c @@ -37,9 +37,9 @@ static void random_recv_done(struct virt { int len; - /* We never get spurious callbacks. */ + /* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */ if (!vq->vq_ops->get_buf(vq, &len)) - BUG(); + return; data_left = len / sizeof(random_data[0]); complete(&have_data);
2008 Jan 14
1
[PATCH] fix bug in virtio-rng
...+ 1 file changed, 3 insertions(+) Index: kvm/drivers/char/hw_random/virtio-rng.c =================================================================== --- kvm.orig/drivers/char/hw_random/virtio-rng.c +++ kvm/drivers/char/hw_random/virtio-rng.c @@ -29,6 +29,9 @@ static bool have_data; static void random_recv_done(struct virtqueue *vq) { + int len = 0; + vq->vq_ops->get_buf(vq, &len); + BUG_ON(!len); have_data = true; /* No need to call disable_cb: there can't be any more since we -- IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Gesch?ftsf?hrung: Herbert...