Re: FW: Notification from Qemu to Guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> ============================================================================
> And as a part of handle output for kick in the qemu side I am simply calling "virtio_notify"
> static void virtio_sample_handle_output(VirtIODevice *vdev, VirtQueue *vq)
> {
>            printf("Function = %s, Line = %d\n",__FUNCTION__,__LINE__);
>            virtio_notify(vdev, vq);
> }
>
> Kick is working fine as I am landing in Qemu when making that call, However virtio_notify is not resulting in my callback invocation registered as part find_vq.
> Do you see any missing parts here?
>

I was playing a bit today with my own virtio driver (I have locally
applied my PCI ID patch) and I bumped into your problem
for a few minutes. I think what you are missing is that your queue is
empty and since you probably haven't negotiated the
VIRTIO_F_NOTIFY_ON_EMPTY feature, you are falling victim of this code in qemu:

hw/virtio.c:669

void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
{
    /* Always notify when queue is empty (when feature acknowledge) */
    if ((vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT) &&
        (!(vdev->features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) ||
         (vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx)))
        return;
        ^^^^^^^^
        This is why you are not getting your interrupt


    vdev->isr |= 0x01;
    virtio_update_irq(vdev);
}


HTH,
Pantelis
--
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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux