From: Gleb Natapov <gleb@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Yan Vugenfirer <yvugenfi@redhat.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests
Date: Mon, 1 Mar 2010 13:26:37 +0200 [thread overview]
Message-ID: <20100301112637.GH16909@redhat.com> (raw)
In-Reply-To: <BAEAF048-3CD5-4F5E-B938-DBB751F35318@suse.de>
On Mon, Mar 01, 2010 at 12:14:43PM +0100, Alexander Graf wrote:
>
> On 14.09.2009, at 15:31, Yan Vugenfirer wrote:
>
> > Signed-off-by: Yan Vugenfirer <yvugenfi@redhat.com>
> >
> > ---
> > hw/virtio-pci.c | 14 ++++++++++++--
> > 1 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> > index f812ab7..a0a22c4 100644
> > --- a/hw/virtio-pci.c
> > +++ b/hw/virtio-pci.c
> > @@ -364,8 +364,17 @@ static void virtio_map(PCIDevice *pci_dev, int region_num,
> > static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,
> > uint32_t val, int len)
> > {
> > + VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
> > +
> > + if (PCI_COMMAND == address) {
> > + if (!(val & PCI_COMMAND_MASTER)) {
> > + proxy->vdev->status &= ~VIRTIO_CONFIG_S_DRIVER_OK;
>
> This part breaks PCI hotplug with Linux guests.
>
> What happens is the following:
Looks like something is broken even without this patch.
>
> (qemu) pci_add auto nic model=virtio,vlan=0
> - Virtio dev 1 -> write config (0)
> - Virtio dev 1 -> write config (0x3)
> - Virtio dev 1 -> set status explicitly to OK
Why Linux doesn't enable bus mastering on this device?
>
> (qemu) pci_add auto storage file=/tmp/image.raw,if=virtio
> - Virtio dev 1 -> write config (0x3)
Why Linux touches unrelated device's config space?
> -> Unset DRIVER_OK bit
> -> network device becomes unresponsive
> - Virtio dev 2 -> write config (0)
> - Virtio dev 2 -> write config (0x3)
> - Virtio dev 2 -> set status explicitly to OK
>
>
> Please either revert this patch or provide a proper fix.
>
> Alex
--
Gleb.
next prev parent reply other threads:[~2010-03-01 11:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 13:31 [Qemu-devel] [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests Yan Vugenfirer
2010-03-01 11:14 ` Alexander Graf
2010-03-01 11:26 ` Gleb Natapov [this message]
2010-03-02 10:09 ` Michael S. Tsirkin
2010-03-02 11:03 ` Alexander Graf
2010-03-02 11:05 ` Michael S. Tsirkin
2010-03-02 11:43 ` Alexander Graf
-- strict thread matches above, loose matches on Subject: below --
2009-09-08 14:49 Yan Vugenfirer
2009-09-11 13:36 ` Anthony Liguori
2009-09-13 11:47 ` Yan Vugenfirer
2009-09-14 12:50 ` Anthony Liguori
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=20100301112637.GH16909@redhat.com \
--to=gleb@redhat.com \
--cc=agraf@suse.de \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yvugenfi@redhat.com \
/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).