search for: num_descs

Displaying 16 results from an estimated 16 matches for "num_descs".

2007 Aug 17
1
lguest virtio_descriptor structure on 64bit
Hello Rusty, while playing with your virtio descriptor code, I realized that the desc_pages data structure is not 64 bit safe. struct lguest_desc desc[NUM_DESCS] can be smaller than a page, as struct lguest_desc is 24 bytes on 64bit systems. Lets add a char padding to make the next page really page aligned. Btw. the new_io_desc.patch does not apply on current git. What base should I use? --- lguest_virtio.c.old 2007-08-17 10:15:05.000000000 +0200 ++...
2007 Aug 17
1
lguest virtio_descriptor structure on 64bit
Hello Rusty, while playing with your virtio descriptor code, I realized that the desc_pages data structure is not 64 bit safe. struct lguest_desc desc[NUM_DESCS] can be smaller than a page, as struct lguest_desc is 24 bytes on 64bit systems. Lets add a char padding to make the next page really page aligned. Btw. the new_io_desc.patch does not apply on current git. What base should I use? --- lguest_virtio.c.old 2007-08-17 10:15:05.000000000 +0200 ++...
2007 Nov 14
1
[PATCH] Remove pagesize parameter from vring_init/vring_size
...gesize()) +#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) + #include "linux/lguest_launcher.h" #include "linux/virtio_config.h" #include "linux/virtio_net.h" @@ -1036,7 +1041,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, void *p; /* First we need some pages for this virtqueue. */ - pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) + pages = (vring_size(num_descs) + getpagesize() - 1) / getpagesize(); p = get_pages(pages); @@ -1046,7 +1051,7 @@ static void add_virtqueue(struct device *...
2007 Nov 14
1
[PATCH] Remove pagesize parameter from vring_init/vring_size
...gesize()) +#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) + #include "linux/lguest_launcher.h" #include "linux/virtio_config.h" #include "linux/virtio_net.h" @@ -1036,7 +1041,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, void *p; /* First we need some pages for this virtqueue. */ - pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) + pages = (vring_size(num_descs) + getpagesize() - 1) / getpagesize(); p = get_pages(pages); @@ -1046,7 +1051,7 @@ static void add_virtqueue(struct device *...
2008 Apr 05
11
[PATCH RFC 1/5] vringfd syscall
...d) { + kunmap(vr->used_page); + put_page(vr->used_page); + } + + kfree(vr); + return 0; +} + +static const struct file_operations vring_fops = { + .release = vring_release, + .write = vring_write, + .poll = vring_poll, +}; + +asmlinkage long sys_vringfd(void __user *addr, + unsigned num_descs, + u16 __user *last_used) +{ + int fd, err; + struct file *filp; + struct vring_info *vr; + + /* Must be a power of two, and representable by u16 */ + if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) { + err = -EINVAL; + goto out; + } + + fd = get_unused_fd(); + if...
2008 Apr 05
11
[PATCH RFC 1/5] vringfd syscall
...d) { + kunmap(vr->used_page); + put_page(vr->used_page); + } + + kfree(vr); + return 0; +} + +static const struct file_operations vring_fops = { + .release = vring_release, + .write = vring_write, + .poll = vring_poll, +}; + +asmlinkage long sys_vringfd(void __user *addr, + unsigned num_descs, + u16 __user *last_used) +{ + int fd, err; + struct file *filp; + struct vring_info *vr; + + /* Must be a power of two, and representable by u16 */ + if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) { + err = -EINVAL; + goto out; + } + + fd = get_unused_fd(); + if...
2007 Aug 16
3
[kvm-devel] [PATCH 00/10] PV-IO v3
...he descriptor entries and the "pending" ring buffer, and write to the "used" ring buffer. We can use page protection to share these if we arrange things carefully, like so: struct desc_pages { /* Page of descriptors. */ struct lguest_desc desc[NUM_DESCS]; /* Next page: how we tell other side what buffers are available. */ unsigned int avail_idx; unsigned int available[NUM_DESCS]; char pad[PAGE_SIZE - (NUM_DESCS+1) * sizeof(unsigned int)]; /* Third page: how other side tells us what'...
2007 Aug 16
3
[kvm-devel] [PATCH 00/10] PV-IO v3
...he descriptor entries and the "pending" ring buffer, and write to the "used" ring buffer. We can use page protection to share these if we arrange things carefully, like so: struct desc_pages { /* Page of descriptors. */ struct lguest_desc desc[NUM_DESCS]; /* Next page: how we tell other side what buffers are available. */ unsigned int avail_idx; unsigned int available[NUM_DESCS]; char pad[PAGE_SIZE - (NUM_DESCS+1) * sizeof(unsigned int)]; /* Third page: how other side tells us what'...
2008 Dec 29
0
[PULL] virtio and lguest tree
...vring_size(vq->config.num, getpagesize())); + vring_size(vq->config.num, LGUEST_VRING_ALIGN)); lg_last_avail(vq) = 0; } } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { @@ -1211,7 +1166,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, void *p; /* First we need some memory for this virtqueue. */ - pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) + pages = (vring_size(num_descs, LGUEST_VRING_ALIGN) + getpagesize() - 1) / getpagesize(); p = get_pages(pages); @@ -1228,7 +1183,7 @@ static void add_virt...
2008 Dec 29
0
[PULL] virtio and lguest tree
...vring_size(vq->config.num, getpagesize())); + vring_size(vq->config.num, LGUEST_VRING_ALIGN)); lg_last_avail(vq) = 0; } } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { @@ -1211,7 +1166,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, void *p; /* First we need some memory for this virtqueue. */ - pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) + pages = (vring_size(num_descs, LGUEST_VRING_ALIGN) + getpagesize() - 1) / getpagesize(); p = get_pages(pages); @@ -1228,7 +1183,7 @@ static void add_virt...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...dds a virtqueue to a device. We specify how many descriptors - * the virtqueue is to have. */ +/* Each device descriptor is followed by the description of its virtqueues. We + * specify how many descriptors the virtqueue is to have. */ static void add_virtqueue(struct device *dev, unsigned int num_descs, void (*handle_output)(int fd, struct virtqueue *me)) { @@ -1053,9 +1043,15 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, /* Initialize the vring. */ vring_init(&vq->vring, num_descs, p, getpagesize()); - /* Add the configuration inf...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...dds a virtqueue to a device. We specify how many descriptors - * the virtqueue is to have. */ +/* Each device descriptor is followed by the description of its virtqueues. We + * specify how many descriptors the virtqueue is to have. */ static void add_virtqueue(struct device *dev, unsigned int num_descs, void (*handle_output)(int fd, struct virtqueue *me)) { @@ -1053,9 +1043,15 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, /* Initialize the vring. */ vring_init(&vq->vring, num_descs, p, getpagesize()); - /* Add the configuration inf...
2008 May 30
2
[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is
2008 May 30
2
[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c