Displaying 20 results from an estimated 114 matches for "random_data".
2008 May 26
1
[PATCH] 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 at de.ibm.com>
---
drivers/char/hw_random/virtio-rng.c | 10 ++++++...
2008 May 26
1
[PATCH] 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 at de.ibm.com>
---
drivers/char/hw_random/virtio-rng.c | 10 ++++++...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 2/13] [Mostly resend] virtio additions
...Fifth Floor, Boston, MA
02110-1301 USA
+ */
+#include <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 sca...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 2/13] [Mostly resend] virtio additions
...Fifth Floor, Boston, MA
02110-1301 USA
+ */
+#include <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 sca...
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
...pool_free(vbr, vblk->pool);
return false;
}
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -51,7 +51,7 @@ static void register_buffer(void)
sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left);
/* There should always be room for one buffer. */
- if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0)
+ if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) < 0)
BUG();
vq->vq_ops->kick(vq);
}
diff --git a/drivers/c...
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
...pool_free(vbr, vblk->pool);
return false;
}
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -51,7 +51,7 @@ static void register_buffer(void)
sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left);
/* There should always be room for one buffer. */
- if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0)
+ if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) < 0)
BUG();
vq->vq_ops->kick(vq);
}
diff --git a/drivers/c...
2008 Jan 14
1
[PATCH] fix bug in virtio-rng
Rusty,
I have seen an oops triggered by the following bug statement in
virtio-rng:
if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0)
BUG();
The problem is that we never called get_buf for complete buffers.
The fix is simple: We have to free the buffer on interrupt to
avoid a virtqueue "overflow".
Christian
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
drivers/char/hw_random/vir...
2007 Feb 21
1
random uniform sample of points on an ellipsoid (e.g. WGS84)
I am interested in making a random sample from a uniform distribution
of points over the surface of the earth, using the WGS84 ellipsoid as
a model for the earth. I know how to do this for a sphere, but would
like to do better. I can supply random numbers, want latitude
longitude pairs out.
Can anyone point me at a solution? Thanks very much.
--
Russell Senior ``I have nine fingers;
2008 Jan 14
1
[PATCH] fix bug in virtio-rng
Rusty,
I have seen an oops triggered by the following bug statement in
virtio-rng:
if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0)
BUG();
The problem is that we never called get_buf for complete buffers.
The fix is simple: We have to free the buffer on interrupt to
avoid a virtqueue "overflow".
Christian
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
drivers/char/hw_random/vir...
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h | 5 +++++
2 files changed, 13
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h | 5 +++++
2 files changed, 13
2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
One of my controllers directly renders some JSON output that I would
like to test with RSpec. For that I use ''response.should
have_text("foobar")'' in my spec file, but that leads to a
Failure/Error: response.should have_text("enim")
undefined method `has_text?'' for #<ActionController::TestResponse:
0xb6736944>
I read here somewhere that webrat
2008 Jan 14
1
[PATCH] virtio_rng: adopt driver to newest virtio code
...insertions(+), 3 deletions(-)
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
@@ -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...
2009 Apr 23
1
[PATCH] virtio-rng: Remove false BUG for spurious callbacks
...om/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] virtio_rng: adopt driver to newest virtio code
...insertions(+), 3 deletions(-)
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
@@ -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...
2009 Apr 23
1
[PATCH] virtio-rng: Remove false BUG for spurious callbacks
...om/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);
2018 Dec 28
1
[PATCH nbdkit] common: Improve pseudo-random number generation.
...+
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
struct error_settings {
@@ -222,17 +224,13 @@ error_config (nbdkit_next_config *next, void *nxdata,
" Apply settings only to read/write/trim/zero"
struct handle {
-#ifdef __GNU_LIBRARY__
- struct random_data rd;
- char rd_state[32];
-#endif
+ struct random_state random_state;
};
static void *
error_open (nbdkit_next_open *next, void *nxdata, int readonly)
{
struct handle *h;
- time_t t;
if (next (nxdata, readonly) == -1)
return NULL;
@@ -242,11 +240,7 @@ error_open (nbdkit_next_op...
2018 Dec 28
0
[PATCH v2 nbdkit] common: Improve pseudo-random number generation.
...+
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
struct error_settings {
@@ -222,17 +224,13 @@ error_config (nbdkit_next_config *next, void *nxdata,
" Apply settings only to read/write/trim/zero"
struct handle {
-#ifdef __GNU_LIBRARY__
- struct random_data rd;
- char rd_state[32];
-#endif
+ struct random_state random_state;
};
static void *
error_open (nbdkit_next_open *next, void *nxdata, int readonly)
{
struct handle *h;
- time_t t;
if (next (nxdata, readonly) == -1)
return NULL;
@@ -242,11 +240,7 @@ error_open (nbdkit_next_op...
2018 Dec 28
2
[PATCH v2 nbdkit] common: Improve pseudo-random number generation.
v2:
- Fix seeding.
- Add a test that nbdkit-random-plugin is producing something
which looks at least somewhat random.
Rich.
2010 Dec 14
8
builder-ubuntu febootstrap success 85db2a664c820e01a02ddc3b33b3da26fe05dc5b
...... yes
checking whether snprintf is declared without a macro... yes
checking whether tmpfile is declared without a macro... yes
checking whether vdprintf is declared without a macro... yes
checking whether vsnprintf is declared without a macro... yes
checking for random.h... no
checking for struct random_data... yes
checking whether _Exit is declared without a macro... yes
checking whether atoll is declared without a macro... yes
checking whether canonicalize_file_name is declared without a macro... yes
checking whether getloadavg is declared without a macro... yes
checking whether getsubopt is declared...