Re: [Xen-devel] potential integer overflow in xenbus_file_write()

2012-10-16 Thread Jan Beulich
On 15.10.12 at 12:25, Ian Campbell ian.campb...@citrix.com wrote: On Thu, 2012-09-13 at 19:00 +0300, Dan Carpenter wrote: Hi, Thanks Dan. I'm not sure anyone from Xen-land really monitors virtualization@. Adding xen-devel and Konrad. I was reading some code and had a question in

Re: [Xen-devel] memory corruption in HYPERVISOR_physdev_op()

2012-10-16 Thread Jan Beulich
On 15.10.12 at 12:27, Ian Campbell ian.campb...@citrix.com wrote: My static analyzer complains about potential memory corruption in HYPERVISOR_physdev_op() arch/x86/include/asm/xen/hypercall.h 389 static inline int 390 HYPERVISOR_physdev_op(int cmd, void *arg) 391 { 392

Re: Using PCI config space to indicate config location

2012-10-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Oct 12, 2012 at 08:21:50PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Fri, Oct 12, 2012 at 08:59:36AM +1030, Rusty Russell wrote: For writes, the standard seems to be a commit latch. We could abuse the

Re: Using PCI config space to indicate config location

2012-10-16 Thread Michael S. Tsirkin
On Tue, Oct 16, 2012 at 11:45:41PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Fri, Oct 12, 2012 at 08:21:50PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Fri, Oct 12, 2012 at 08:59:36AM +1030, Rusty Russell wrote: For writes,

[PATCH 2/5] virtio-net: remove unused skb_vnet_hdr-num_sg field

2012-10-16 Thread Rusty Russell
From: Michael S. Tsirkin m...@redhat.com [Split from correct capacity math on ring full -- Rusty] Signed-off-by: Michael S. Tsirkin m...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/net/virtio_net.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH 4/5] virtio_net: don't rely on virtqueue_add_buf() returning capacity.

2012-10-16 Thread Rusty Russell
Now we can easily use vq-num_free to determine if there are descriptors left in the queue, we're about to change virtqueue_add_buf() to return 0 on success. The virtio_net driver is the only one which actually uses the return value, so change that. Signed-off-by: Rusty Russell

[PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.

2012-10-16 Thread Rusty Russell
They're generic concepts, so hoist them. This also avoids accessor functions. This goes even further than Jason Wang's 17bb6d4088 patch (virtio-ring: move queue_index to vring_virtqueue) which moved the queue_index from the specific transport. Signed-off-by: Rusty Russell ru...@rustcorp.com.au

[PATCH 5/5] virtio: make virtqueue_add_buf() returning 0 on success, not capacity.

2012-10-16 Thread Rusty Russell
Now noone relies on this behavior, we simplify virtqueue_add_buf() so it return 0 or -errno. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring.c

Re: [PATCH 4/5] virtio_net: don't rely on virtqueue_add_buf() returning capacity.

2012-10-16 Thread Michael S. Tsirkin
On Wed, Oct 17, 2012 at 12:00:51AM +1030, Rusty Russell wrote: Now we can easily use vq-num_free to determine if there are descriptors left in the queue, we're about to change virtqueue_add_buf() to return 0 on success. The virtio_net driver is the only one which actually uses the return

Re: [PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.

2012-10-16 Thread Michael S. Tsirkin
On Wed, Oct 17, 2012 at 12:00:48AM +1030, Rusty Russell wrote: They're generic concepts, so hoist them. This also avoids accessor functions. This goes even further than Jason Wang's 17bb6d4088 patch (virtio-ring: move queue_index to vring_virtqueue) which moved the queue_index from the

Re: [PATCH 5/5] virtio: make virtqueue_add_buf() returning 0 on success, not capacity.

2012-10-16 Thread Rusty Russell
Note: I also have minor cleanups to virtio drivers to change (ret = 0) to (ret == 0) where it would otherwise be confusing for new readers, but I didn't clutter the list with them. See my virtio-wip tree for the gory details. Cheers, Rusty. ___

Re: [PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.

2012-10-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Oct 17, 2012 at 12:00:48AM +1030, Rusty Russell wrote: * @priv: a pointer for the virtqueue implementation to use. + * @index: the zero-based ordinal number for this queue. + * @num_free: number of buffers we expect to be able to fit. Only

Re: [PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.

2012-10-16 Thread Michael S. Tsirkin
On Wed, Oct 17, 2012 at 12:00:48AM +1030, Rusty Russell wrote: They're generic concepts, so hoist them. This also avoids accessor functions. This goes even further than Jason Wang's 17bb6d4088 patch (virtio-ring: move queue_index to vring_virtqueue) which moved the queue_index from the

[PATCH] xen/xenbus: silence GCC warning

2012-10-16 Thread Paul Bolle
Compiling xenbus_xs.o triggers this GCC warning: drivers/xen/xenbus/xenbus_xs.c:628:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes] Add the obvious and trivial fix. While we're touching this function add some equally obvious and trivial whitespace fixes.