qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Fam Zheng <famz@redhat.com>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset
Date: Thu, 12 Mar 2015 12:15:18 +0100	[thread overview]
Message-ID: <20150312120624-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <CAFEAcA_DmyU+-36Bhk-9xpVkzQrro0Owgz+NJU1VciS_y89NFg@mail.gmail.com>

On Thu, Mar 12, 2015 at 11:04:33AM +0000, Peter Maydell wrote:
> On 12 March 2015 at 10:57, Michael S. Tsirkin <mst@redhat.com> 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	other threads:[~2015-03-12 11:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  6:40 [Qemu-devel] [PATCH] virtio-pci: Clear IRQ at reset Fam Zheng
2015-03-12  7:22 ` Michael S. Tsirkin
2015-03-12  7:58   ` Fam Zheng
2015-03-12  9:41 ` Michael S. Tsirkin
2015-03-12 10:00   ` Fam Zheng
2015-03-12 10:06     ` Michael S. Tsirkin
2015-03-12 10:16     ` Michael S. Tsirkin
2015-03-12 10:21       ` Peter Maydell
2015-03-12 10:57         ` Michael S. Tsirkin
2015-03-12 11:04           ` Peter Maydell
2015-03-12 11:15             ` Michael S. Tsirkin [this message]
2015-03-13  6:07               ` Fam Zheng
2015-03-13  6:28                 ` Fam Zheng
2015-03-16  5:09                   ` Michael S. Tsirkin
2015-03-13 14:19                 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150312120624-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=famz@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).