qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset
Date: Thu, 12 Mar 2015 12:15:18 +0100

On Thu, Mar 12, 2015 at 11:04:33AM +0000, Peter Maydell wrote:
> On 12 March 2015 at 10:57, Michael S. Tsirkin <address@hidden> wrote:
> > This isn't a device reset though.
> > The function that Fam is touching is called
> > when a special "virtio reset" register to
> > poked by the driver.
> > It only resets part of the device, not all of it,
> > and it seems reasonable to ask that it clear the
> > interrupt.
> 
> Oh, right, sorry. Yes, that should clear the interrupt, then.
> (Is there a similar bug on other virtio transports?)
> 
> -- PMM

Hmm interesting.

I looked at virtio_reset and that one does:
    vdev->isr = 0;
    vdev->config_vector = VIRTIO_NO_VECTOR;
    virtio_notify_vector(vdev, vdev->config_vector);

which in turn would call
static void virtio_pci_notify(DeviceState *d, uint16_t vector)
{
    VirtIOPCIProxy *proxy = to_virtio_pci_proxy_fast(d);

    if (msix_enabled(&proxy->pci_dev))
        msix_notify(&proxy->pci_dev, vector);
    else {
        VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
        pci_set_irq(&proxy->pci_dev, vdev->isr & 1);
    }
}

since isr is 0, and msi is disabled, it looks like
pci_set_irq will get invoked automatically.

so at this point I stopped understanding how can
this patch help.

Fam, does your patch actually help some guests?
Could you pls investigate why isn't virtio_reset
sufficient?


-- 
MST



reply via email to

[Prev in Thread] Current Thread [Next in Thread]