From: Julia Suvorova <jusual@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio-pci: Add Function Level Reset support
Date: Wed, 14 Aug 2019 19:22:41 +0200 [thread overview]
Message-ID: <CAMDeoFUhr9T1bSokO=jhq5=2Ra04TX6K0_w4oUP1oDYCYecF9A@mail.gmail.com> (raw)
In-Reply-To: <20190809123341-mutt-send-email-mst@kernel.org>
On Fri, Aug 9, 2019 at 6:35 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Wed, Aug 07, 2019 at 10:22:41AM +0200, Julia Suvorova wrote:
> > Using FLR becomes convenient in cases where resetting the bus is
> > impractical, for example, when debugging the behavior of individual
> > functions.
> >
> > Signed-off-by: Julia Suvorova <jusual@redhat.com>
> > ---
> > hw/virtio/virtio-pci.c | 10 ++++++++++
> > hw/virtio/virtio-pci.h | 1 +
> > 2 files changed, 11 insertions(+)
> >
> > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > index f6d2223e78..37c5d6efbc 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -599,6 +599,10 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,
> >
> > pci_default_write_config(pci_dev, address, val, len);
> >
> > + if (proxy->has_flr) {
> > + pcie_cap_flr_write_config(pci_dev, address, val, len);
> > + }
> > +
> > if (range_covers_byte(address, len, PCI_COMMAND) &&
> > !(pci_dev->config[PCI_COMMAND] & PCI_COMMAND_MASTER)) {
> > virtio_pci_stop_ioeventfd(proxy);
> > @@ -1718,6 +1722,8 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)
> > proxy->notify_pio.size = 0x4;
> > proxy->notify_pio.type = VIRTIO_PCI_CAP_NOTIFY_CFG;
> >
> > + proxy->has_flr = false;
> > +
> > /* subclasses can enforce modern, so do this unconditionally */
> > memory_region_init(&proxy->modern_bar, OBJECT(proxy), "virtio-pci",
> > /* PCI BAR regions must be powers of 2 */
> > @@ -1749,6 +1755,10 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)
> >
> > pci_dev->exp.pm_cap = pos;
> >
> > + /* Set Function Level Reset capability bit */
> > + pcie_cap_flr_init(pci_dev);
> > + proxy->has_flr = true;
> > +
> > /*
> > * Indicates that this function complies with revision 1.2 of the
> > * PCI Power Management Interface Specification.
>
>
> I don't think we can set this for everyone: this will break
> things like cross version migration.
I see. If I add a flag and a property, which version of hw_compat should I use?
Best regards, Julia Suvorova.
prev parent reply other threads:[~2019-08-14 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 8:22 [Qemu-devel] [PATCH] virtio-pci: Add Function Level Reset support Julia Suvorova
2019-08-09 16:35 ` Michael S. Tsirkin
2019-08-14 17:22 ` Julia Suvorova [this message]
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='CAMDeoFUhr9T1bSokO=jhq5=2Ra04TX6K0_w4oUP1oDYCYecF9A@mail.gmail.com' \
--to=jusual@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=mst@redhat.com \
--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).