search for: init_us

Displaying 20 results from an estimated 40 matches for "init_us".

Did you mean: init_s
2011 Jun 21
1
[PATCH 1/2] vhost: init used ring after backend was set
...+), 8 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index e224a92..957421b 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -637,6 +637,10 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) vhost_net_enable_vq(n, vq); } + r = init_used(vq); + if (r) + goto err_vq; + mutex_unlock(&vq->mutex); if (oldsock) { diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2a10786..43a3fc6 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -578,15 +578,14 @@ static long vhost_set_memory(struct vhost_de...
2011 Jun 21
1
[PATCH 1/2] vhost: init used ring after backend was set
...+), 8 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index e224a92..957421b 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -637,6 +637,10 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) vhost_net_enable_vq(n, vq); } + r = init_used(vq); + if (r) + goto err_vq; + mutex_unlock(&vq->mutex); if (oldsock) { diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2a10786..43a3fc6 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -578,15 +578,14 @@ static long vhost_set_memory(struct vhost_de...
2009 Nov 22
1
[PATCH] vhost: Fix warnings and bad type handling
...r != a.desc_user_addr || (u64)(unsigned long)a.used_user_addr != a.used_user_addr || (u64)(unsigned long)a.avail_user_addr != a.avail_user_addr) { @@ -334,7 +336,8 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) r = -EINVAL; break; } - r = init_used(vq, (struct vring_used __user *)a.used_user_addr); + r = init_used(vq, (struct vring_used __user *)(unsigned long) + a.used_user_addr); if (r) break; vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG)); -- 1.6.5.2.143.g8cc62
2009 Nov 22
1
[PATCH] vhost: Fix warnings and bad type handling
...r != a.desc_user_addr || (u64)(unsigned long)a.used_user_addr != a.used_user_addr || (u64)(unsigned long)a.avail_user_addr != a.avail_user_addr) { @@ -334,7 +336,8 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) r = -EINVAL; break; } - r = init_used(vq, (struct vring_used __user *)a.used_user_addr); + r = init_used(vq, (struct vring_used __user *)(unsigned long) + a.used_user_addr); if (r) break; vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG)); -- 1.6.5.2.143.g8cc62
2011 Jun 16
1
[PATCH] vhost: set dirty log when updating flags of used ring
...anged, 24 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2ab2912..7c46aed 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -573,8 +573,10 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) static int init_used(struct vhost_virtqueue *vq, struct vring_used __user *used) { - int r = put_user(vq->used_flags, &used->flags); + int r; + vq->used = used; + r = vhost_update_used_flags(vq); if (r) return r; return get_user(vq->last_used_idx, &used->idx); @@ -700,7 +702,6...
2011 Jun 16
1
[PATCH] vhost: set dirty log when updating flags of used ring
...anged, 24 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2ab2912..7c46aed 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -573,8 +573,10 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) static int init_used(struct vhost_virtqueue *vq, struct vring_used __user *used) { - int r = put_user(vq->used_flags, &used->flags); + int r; + vq->used = used; + r = vhost_update_used_flags(vq); if (r) return r; return get_user(vq->last_used_idx, &used->idx); @@ -700,7 +702,6...
2016 Feb 10
2
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
On Wed, Jan 13, 2016 at 06:09:47PM +0100, Greg Kurz wrote: > The way vring endianness is being handled currently obfuscates > the code in vhost_init_used(). > > This patch tries to fix that by doing the following: > - move the the code that adjusts endianness to a dedicated helper > - export this helper so that backends explicitely call it > > No behaviour change. > > Signed-off-by: Greg Kurz <gkurz at linux.vnet.ibm....
2016 Feb 10
2
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
On Wed, Jan 13, 2016 at 06:09:47PM +0100, Greg Kurz wrote: > The way vring endianness is being handled currently obfuscates > the code in vhost_init_used(). > > This patch tries to fix that by doing the following: > - move the the code that adjusts endianness to a dedicated helper > - export this helper so that backends explicitely call it > > No behaviour change. > > Signed-off-by: Greg Kurz <gkurz at linux.vnet.ibm....
2007 Jul 09
7
request.remote_ip
Hi, How can i access to request.remote_ip in a model? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to
2016 Feb 10
0
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
On Wed, 10 Feb 2016 13:48:09 +0200 "Michael S. Tsirkin" <mst at redhat.com> wrote: > On Wed, Jan 13, 2016 at 06:09:47PM +0100, Greg Kurz wrote: > > The way vring endianness is being handled currently obfuscates > > the code in vhost_init_used(). > > > > This patch tries to fix that by doing the following: > > - move the the code that adjusts endianness to a dedicated helper > > - export this helper so that backends explicitely call it > > > > No behaviour change. > > > > Signed-off-by...
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...g access for used ring if enabled. */ + if ((a.flags & (0x1 << VHOST_VRING_F_LOG)) && + !log_access_ok(vq->log_base, a.log_guest_addr, + sizeof *vq->used + + vq->num * sizeof *vq->used->ring)) { + r = -EINVAL; + break; + } + } + r = init_used(vq, (struct vring_used __user *)(unsigned long) a.used_user_addr); if (r) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index d1f0453..44591ba 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -117,6 +117,8 @@ long vhost_dev_check_owner(struct vhost_dev *...
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...g access for used ring if enabled. */ + if ((a.flags & (0x1 << VHOST_VRING_F_LOG)) && + !log_access_ok(vq->log_base, a.log_guest_addr, + sizeof *vq->used + + vq->num * sizeof *vq->used->ring)) { + r = -EINVAL; + break; + } + } + r = init_used(vq, (struct vring_used __user *)(unsigned long) a.used_user_addr); if (r) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index d1f0453..44591ba 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -117,6 +117,8 @@ long vhost_dev_check_owner(struct vhost_dev *...
2016 Feb 16
5
[PATCH v2 0/3] vhost: cross-endian code cleanup
This series is a new tentative to have cleaner cross-endian code. Patches 1/3 is new: it fixes a side-effect in case vhost_init_used() fails. Patch 2/3 comes from v1: it renames cross-endian helpers Patch 3/3 is new: it simply renames vhost_init_used() as suggested by Michael. --- Greg Kurz (3): vhost: fix error path in vhost_init_used() vhost: rename cross-endian helpers vhost: rename vhost_init_used()...
2016 Feb 16
5
[PATCH v2 0/3] vhost: cross-endian code cleanup
This series is a new tentative to have cleaner cross-endian code. Patches 1/3 is new: it fixes a side-effect in case vhost_init_used() fails. Patch 2/3 comes from v1: it renames cross-endian helpers Patch 3/3 is new: it simply renames vhost_init_used() as suggested by Michael. --- Greg Kurz (3): vhost: fix error path in vhost_init_used() vhost: rename cross-endian helpers vhost: rename vhost_init_used()...
2009 Aug 11
2
[PATCHv2 2/2] vhost_net: a kernel-level virtio server
...amp;mem, size); + r = copy_from_user(newmem->regions, m->regions, + mem.nregions * sizeof *m->regions); + if (r) { + kfree(newmem); + return r; + } + oldmem = d->memory; + rcu_assign_pointer(d->memory, newmem); + synchronize_rcu(); + kfree(oldmem); + return 0; +} + +static int init_used(struct vhost_virtqueue *vq) +{ + u16 flags = 0; + int r = put_user(flags, &vq->used->flags); + if (r) + return r; + return get_user(vq->last_used_idx, &vq->used->idx); +} + +static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) +{ + struct file *ev...
2009 Aug 11
2
[PATCHv2 2/2] vhost_net: a kernel-level virtio server
...amp;mem, size); + r = copy_from_user(newmem->regions, m->regions, + mem.nregions * sizeof *m->regions); + if (r) { + kfree(newmem); + return r; + } + oldmem = d->memory; + rcu_assign_pointer(d->memory, newmem); + synchronize_rcu(); + kfree(oldmem); + return 0; +} + +static int init_used(struct vhost_virtqueue *vq) +{ + u16 flags = 0; + int r = put_user(flags, &vq->used->flags); + if (r) + return r; + return get_user(vq->last_used_idx, &vq->used->idx); +} + +static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) +{ + struct file *ev...
2009 Aug 27
5
[PATCHv5 3/3] vhost_net: a kernel-level virtio server
...amp;mem, size); + r = copy_from_user(newmem->regions, m->regions, + mem.nregions * sizeof *m->regions); + if (r) { + kfree(newmem); + return r; + } + oldmem = d->memory; + rcu_assign_pointer(d->memory, newmem); + synchronize_rcu(); + kfree(oldmem); + return 0; +} + +static int init_used(struct vhost_virtqueue *vq) +{ + int r = put_user(vq->used_flags, &vq->used->flags); + if (r) + return r; + return get_user(vq->last_used_idx, &vq->used->idx); +} + +static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) +{ + struct file *eventfp...
2009 Aug 27
5
[PATCHv5 3/3] vhost_net: a kernel-level virtio server
...amp;mem, size); + r = copy_from_user(newmem->regions, m->regions, + mem.nregions * sizeof *m->regions); + if (r) { + kfree(newmem); + return r; + } + oldmem = d->memory; + rcu_assign_pointer(d->memory, newmem); + synchronize_rcu(); + kfree(oldmem); + return 0; +} + +static int init_used(struct vhost_virtqueue *vq) +{ + int r = put_user(vq->used_flags, &vq->used->flags); + if (r) + return r; + return get_user(vq->last_used_idx, &vq->used->idx); +} + +static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) +{ + struct file *eventfp...
2009 Aug 13
1
[PATCHv3 2/2] vhost_net: a kernel-level virtio server
...amp;mem, size); + r = copy_from_user(newmem->regions, m->regions, + mem.nregions * sizeof *m->regions); + if (r) { + kfree(newmem); + return r; + } + oldmem = d->memory; + rcu_assign_pointer(d->memory, newmem); + synchronize_rcu(); + kfree(oldmem); + return 0; +} + +static int init_used(struct vhost_virtqueue *vq) +{ + u16 flags = 0; + int r = put_user(flags, &vq->used->flags); + if (r) + return r; + return get_user(vq->last_used_idx, &vq->used->idx); +} + +static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) +{ + struct file *ev...
2009 Aug 13
1
[PATCHv3 2/2] vhost_net: a kernel-level virtio server
...amp;mem, size); + r = copy_from_user(newmem->regions, m->regions, + mem.nregions * sizeof *m->regions); + if (r) { + kfree(newmem); + return r; + } + oldmem = d->memory; + rcu_assign_pointer(d->memory, newmem); + synchronize_rcu(); + kfree(oldmem); + return 0; +} + +static int init_used(struct vhost_virtqueue *vq) +{ + u16 flags = 0; + int r = put_user(flags, &vq->used->flags); + if (r) + return r; + return get_user(vq->last_used_idx, &vq->used->idx); +} + +static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) +{ + struct file *ev...