search for: vring_init

Displaying 20 results from an estimated 290 matches for "vring_init".

2007 Nov 14
1
[PATCH] Remove pagesize parameter from vring_init/vring_size
...etpagesize() - 1) + pages = (vring_size(num_descs) + getpagesize() - 1) / getpagesize(); p = get_pages(pages); @@ -1046,7 +1051,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, vq->config.pfn = to_guest_phys(p) / getpagesize(); /* Initialize the vring. */ - vring_init(&vq->vring, num_descs, p, getpagesize()); + vring_init(&vq->vring, num_descs, p); /* Add the configuration information to this device's descriptor. */ add_desc_field(dev, VIRTIO_CONFIG_F_VIRTQUEUE, diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c...
2007 Nov 14
1
[PATCH] Remove pagesize parameter from vring_init/vring_size
...etpagesize() - 1) + pages = (vring_size(num_descs) + getpagesize() - 1) / getpagesize(); p = get_pages(pages); @@ -1046,7 +1051,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, vq->config.pfn = to_guest_phys(p) / getpagesize(); /* Initialize the vring. */ - vring_init(&vq->vring, num_descs, p, getpagesize()); + vring_init(&vq->vring, num_descs, p); /* Add the configuration information to this device's descriptor. */ add_desc_field(dev, VIRTIO_CONFIG_F_VIRTQUEUE, diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c...
2015 Jul 02
2
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). Signed-off-by: Thomas Huth <thuth at redhat.com> --- include/uapi/linux/virtio_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index 9...
2015 Jul 02
2
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). Signed-off-by: Thomas Huth <thuth at redhat.com> --- include/uapi/linux/virtio_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index 9...
2018 Mar 16
3
[PATCH RFC 2/2] virtio_ring: support packed ring
...; &dma_addr, GFP_KERNEL|__GFP_ZERO); >>>>>>> } >>>>>>> if (!queue) >>>>>>> return NULL; >>>>>>> - queue_size_in_bytes = vring_size(num, vring_align); >>>>>>> - vring_init(&vring, num, queue, vring_align); >>>>>>> + queue_size_in_bytes = __vring_size(num, vring_align, packed); >>>>>>> + if (packed) >>>>>>> + vring_packed_init(&vring.vring_packed, num, queue, vring_align); >>>>>>...
2018 Mar 16
3
[PATCH RFC 2/2] virtio_ring: support packed ring
...; &dma_addr, GFP_KERNEL|__GFP_ZERO); >>>>>>> } >>>>>>> if (!queue) >>>>>>> return NULL; >>>>>>> - queue_size_in_bytes = vring_size(num, vring_align); >>>>>>> - vring_init(&vring, num, queue, vring_align); >>>>>>> + queue_size_in_bytes = __vring_size(num, vring_align, packed); >>>>>>> + if (packed) >>>>>>> + vring_packed_init(&vring.vring_packed, num, queue, vring_align); >>>>>>...
2015 Jul 05
0
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > The virtio_ring.h header is used in userspace programs (ie. QEMU), > too. Here we can not assume that sizeof(pointer) is the same as > sizeof(long), e.g. when compiling for Windows, so the typecast in > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > Signed-off-by: Thomas Huth <thuth at redhat.com> This seems to break some userspace too: INSTALL usr/include/linux/ (413 files) CHECK usr/include/linux/ (413 files) HOSTCC Documentation/accounting/getdelays...
2007 Nov 06
1
[PATCH][VIRTIO] Fix vring_init() ring computations
This patch fixes a typo in vring_init(). This happens to work today in lguest because the sizeof(struct vring_desc) is 16 and struct vring contains 3 pointers and an unsigned int so on 32-bit sizeof(struct vring_desc) == sizeof(struct vring). However, this is no longer true on 64-bit where the bug is exposed. Signed-off-by: Anthony...
2007 Nov 06
1
[PATCH][VIRTIO] Fix vring_init() ring computations
This patch fixes a typo in vring_init(). This happens to work today in lguest because the sizeof(struct vring_desc) is 16 and struct vring contains 3 pointers and an unsigned int so on 32-bit sizeof(struct vring_desc) == sizeof(struct vring). However, this is no longer true on 64-bit where the bug is exposed. Signed-off-by: Anthony...
2015 May 06
0
[PATCH] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). This fixes a compiler warning when compiling QEMU with the mingw32 cross-compiler. Signed-off-by: Thomas Huth <thuth at redhat.com> --- include/uapi/linux/virtio_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff...
2015 May 06
0
[PATCH] virtio: Fix typecast of pointer in vring_init()
The virtio_ring.h header is used in userspace programs (ie. QEMU), too. Here we can not assume that sizeof(pointer) is the same as sizeof(long), e.g. when compiling for Windows, so the typecast in vring_init() should be done with (uintptr_t) instead of (unsigned long). This fixes a compiler warning when compiling QEMU with the mingw32 cross-compiler. Signed-off-by: Thomas Huth <thuth at redhat.com> --- include/uapi/linux/virtio_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff...
2007 Nov 15
0
[PATCH] Fix vring_init/vring_size to take unsigned long
...ble. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 1a4ed49..5de09f9 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -89,7 +89,7 @@ struct vring { * }; */ static inline void vring_init(struct vring *vr, unsigned int num, void *p, - unsigned int pagesize) + unsigned long pagesize) { vr->num = num; vr->desc = p; @@ -98,7 +98,7 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p, & ~(pagesize - 1)); } -static inline...
2007 Nov 15
0
[PATCH] Fix vring_init/vring_size to take unsigned long
...ble. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 1a4ed49..5de09f9 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -89,7 +89,7 @@ struct vring { * }; */ static inline void vring_init(struct vring *vr, unsigned int num, void *p, - unsigned int pagesize) + unsigned long pagesize) { vr->num = num; vr->desc = p; @@ -98,7 +98,7 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p, & ~(pagesize - 1)); } -static inline...
2015 Jul 06
0
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
...15 at 09:21:22AM +0200, Thomas Huth wrote: > > > The virtio_ring.h header is used in userspace programs (ie. QEMU), > > > too. Here we can not assume that sizeof(pointer) is the same as > > > sizeof(long), e.g. when compiling for Windows, so the typecast in > > > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > > > > > Signed-off-by: Thomas Huth <thuth at redhat.com> > > > > This seems to break some userspace too: > > > > INSTALL usr/include/linux/ (413 files) > > CHECK usr/incl...
2015 Jul 05
2
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
...; On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > > The virtio_ring.h header is used in userspace programs (ie. QEMU), > > too. Here we can not assume that sizeof(pointer) is the same as > > sizeof(long), e.g. when compiling for Windows, so the typecast in > > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > > > Signed-off-by: Thomas Huth <thuth at redhat.com> > > This seems to break some userspace too: > > INSTALL usr/include/linux/ (413 files) > CHECK usr/include/linux/ (413 files) > HOSTC...
2015 Jul 05
2
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
...; On Thu, Jul 02, 2015 at 09:21:22AM +0200, Thomas Huth wrote: > > The virtio_ring.h header is used in userspace programs (ie. QEMU), > > too. Here we can not assume that sizeof(pointer) is the same as > > sizeof(long), e.g. when compiling for Windows, so the typecast in > > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > > > Signed-off-by: Thomas Huth <thuth at redhat.com> > > This seems to break some userspace too: > > INSTALL usr/include/linux/ (413 files) > CHECK usr/include/linux/ (413 files) > HOSTC...
2019 Sep 03
0
[PATCH] virtio: Change typecasts in vring_init()
...nux/virtio_ring.h b/include/uapi/linux/virtio_ring.h > >>>> index 4c4e24c291a5..2c339b9e2923 100644 > >>>> --- a/include/uapi/linux/virtio_ring.h > >>>> +++ b/include/uapi/linux/virtio_ring.h > >>>> @@ -168,10 +168,11 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p, > >>>> unsigned long align) > >>>> { > >>>> vr->num = num; > >>>> - vr->desc = p; > >>>> - vr->avail = p + num*sizeof(struct vring_desc); > >>...
2015 Jul 06
1
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
...00, Thomas Huth wrote: > > > > The virtio_ring.h header is used in userspace programs (ie. QEMU), > > > > too. Here we can not assume that sizeof(pointer) is the same as > > > > sizeof(long), e.g. when compiling for Windows, so the typecast in > > > > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > > > > > > > Signed-off-by: Thomas Huth <thuth at redhat.com> > > > > > > This seems to break some userspace too: > > > > > > INSTALL usr/include/linux/ (413 files...
2015 Jul 06
1
[PATCH RESEND] virtio: Fix typecast of pointer in vring_init()
...00, Thomas Huth wrote: > > > > The virtio_ring.h header is used in userspace programs (ie. QEMU), > > > > too. Here we can not assume that sizeof(pointer) is the same as > > > > sizeof(long), e.g. when compiling for Windows, so the typecast in > > > > vring_init() should be done with (uintptr_t) instead of (unsigned long). > > > > > > > > Signed-off-by: Thomas Huth <thuth at redhat.com> > > > > > > This seems to break some userspace too: > > > > > > INSTALL usr/include/linux/ (413 files...
2018 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...t; > > > > > > > } > > > > > > > > if (!queue) > > > > > > > > return NULL; > > > > > > > > - queue_size_in_bytes = vring_size(num, vring_align); > > > > > > > > - vring_init(&vring, num, queue, vring_align); > > > > > > > > + queue_size_in_bytes = __vring_size(num, vring_align, packed); > > > > > > > > + if (packed) > > > > > > > > + vring_packed_init(&vring.vring_packed, num, queue, vring...