On Thu, Oct 22, 2009 at 11:00:20AM -0700, Sridhar Samudrala wrote: > On Thu, 2009-10-22 at 19:43 +0200, Michael S. Tsirkin wrote: > > > > > Possibly we'll have to debug this in vhost in host kernel. > > I would debug this directly, it's just that my setup is somehow > > different and I do not see this issue, otherwise I would not > > waste your time. > > > > Can we add some printks? > > handle_tx has this at the top: > > > > if (!sock || !sock_writeable(sock->sk)) > > return; > > I added some debug printks in handle_rx and handle_tx > get_user() calls are failing with EFAULT. > > Oct 21 10:51:41 IBM-19B5263ED41-009047018100 kernel: handle_rx: net:f5494800 > Oct 21 10:51:41 IBM-19B5263ED41-009047018100 kernel: Failed to enable notification: -14 > Oct 21 10:51:41 IBM-19B5263ED41-009047018100 kernel: Failed to access avail idx at 00000002 ret:-14 > Oct 21 10:51:41 IBM-19B5263ED41-009047018100 kernel: Failed to disable notification: -14 > Oct 21 10:51:41 IBM-19B5263ED41-009047018100 kernel: Failed to access avail idx at 00000002 ret:-14 Aha, we are getting somewhere! Thanks very much for looking into this. This suggests strongly that available index pointer is not set up correctly in vhost. I would like to verify this and understand how it came to be incorrect. Sridhar, Shirley, could you please try this: - make sure to enable CONFIG_DYNAMIC_DEBUG=y in .config (if it's not there, you'll have to rebuild kernel, or hack drivers/vhost/vhost.h to use pr_err instead of pr_debug). - echo 'module vhost_net +p' > /sys/kernel/debug/dynamic_debug/control the above will make vhost print address which we tried to access, on error, and they will apear in the output of the dmesg command. In addition, please apply the following debugging patch to qemu. this will make it output data about available index on startup. Thanks! diff --git a/hw/vhost_net.c b/hw/vhost_net.c index bc179ab..d651504 100644 --- a/hw/vhost_net.c +++ b/hw/vhost_net.c @@ -66,6 +66,11 @@ static int vhost_virtqueue_init(struct vhost_dev *dev, r = ioctl(dev->control, VHOST_SET_VRING_AVAIL, &addr); if (r < 0) return -errno; + + fprintf(stderr, "VQ %d, avail va %p(=%llx), pa %llx, num %x size %llx\n", + idx, vq->avail, (unsigned long long)addr.user_addr, + (unsigned long long)q->vring.avail, (unsigned)q->vring.num, s); + s = l = offsetof(struct vring_used, ring) + sizeof(struct vring_used_elem) * q->vring.num; vq->used = cpu_physical_memory_map(q->vring.used, &l, 1); -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html