qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Lopez <slp@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v2 6/7] libqos: make the virtio-pci BAR index configurable
Date: Mon, 14 Oct 2019 12:46:53 +0200	[thread overview]
Message-ID: <87imorzjs2.fsf@redhat.com> (raw)
In-Reply-To: <20191014095214.GI22963@stefanha-x1.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2534 bytes --]


Stefan Hajnoczi <stefanha@redhat.com> writes:

> On Fri, Oct 11, 2019 at 02:06:01PM +0200, Sergio Lopez wrote:
>> 
>> Stefan Hajnoczi <stefanha@redhat.com> writes:
>> 
>> > The Legacy virtio-pci interface always uses BAR 0.  VIRTIO 1.0 may need
>> > to use a different BAR index, so make it configurable.
>> >
>> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>> > ---
>> >  tests/libqos/virtio-pci.h | 2 ++
>> >  tests/libqos/virtio-pci.c | 3 ++-
>> >  2 files changed, 4 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/tests/libqos/virtio-pci.h b/tests/libqos/virtio-pci.h
>> > index b620c30451..f2d53aa377 100644
>> > --- a/tests/libqos/virtio-pci.h
>> > +++ b/tests/libqos/virtio-pci.h
>> > @@ -25,6 +25,8 @@ typedef struct QVirtioPCIDevice {
>> >      uint16_t config_msix_entry;
>> >      uint64_t config_msix_addr;
>> >      uint32_t config_msix_data;
>> > +
>> > +    uint8_t bar_idx;
>> >  } QVirtioPCIDevice;
>> >  
>> >  struct QVirtioPCIMSIXOps {
>> > diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c
>> > index 3fb4af4016..efd8caee18 100644
>> > --- a/tests/libqos/virtio-pci.c
>> > +++ b/tests/libqos/virtio-pci.c
>> > @@ -300,7 +300,7 @@ static const QVirtioPCIMSIXOps qvirtio_pci_msix_ops_legacy = {
>> >  void qvirtio_pci_device_enable(QVirtioPCIDevice *d)
>> >  {
>> >      qpci_device_enable(d->pdev);
>> > -    d->bar = qpci_iomap(d->pdev, 0, NULL);
>> > +    d->bar = qpci_iomap(d->pdev, d->bar_idx, NULL);
>> >  }
>> >  
>> >  void qvirtio_pci_device_disable(QVirtioPCIDevice *d)
>> > @@ -389,6 +389,7 @@ void qvirtio_pci_start_hw(QOSGraphObject *obj)
>> >  static void qvirtio_pci_init_legacy(QVirtioPCIDevice *dev)
>> >  {
>> >      dev->vdev.device_type = qpci_config_readw(dev->pdev, PCI_SUBSYSTEM_ID);
>> > +    dev->bar_idx = 0;
>> >      dev->vdev.bus = &qvirtio_pci_legacy;
>> >      dev->msix_ops = &qvirtio_pci_msix_ops_legacy;
>> >      dev->vdev.big_endian = qtest_big_endian(dev->pdev->bus->qts);
>> 
>> qpci_iomap() is also called with a hardcoded bar at
>> virtio-blk-test.c:test_nonexistent_virtqueue(). Should it be fixed here
>> or in a future patch?
>
> That virtio-blk-pci-specific continues to work because the
> virtio-blk-pci device is a Transitional device that still supports
> Legacy mode in BAR 0.
>
> Also, that test doesn't use the libqos virtio API so there is no
> conflict between it and this patch series.

OK, in that case:

Reviewed-by: Sergio Lopez <slp@redhat.com>

> Stefan


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2019-10-14 10:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11  8:56 [PATCH v2 0/7] libqos: add VIRTIO PCI 1.0 support Stefan Hajnoczi
2019-10-11  8:56 ` [PATCH v2 1/7] libqos: extract Legacy virtio-pci.c code Stefan Hajnoczi
2019-10-11 12:20   ` Sergio Lopez
2019-10-16 12:04   ` Thomas Huth
2019-10-11  8:56 ` [PATCH v2 2/7] libqos: add iteration support to qpci_find_capability() Stefan Hajnoczi
2019-10-11 12:22   ` Sergio Lopez
2019-10-16 12:12   ` Thomas Huth
2019-10-11  8:56 ` [PATCH v2 3/7] libqos: pass full QVirtQueue to set_queue_address() Stefan Hajnoczi
2019-10-11 12:22   ` Sergio Lopez
2019-10-16 12:15   ` Thomas Huth
2019-10-11  8:56 ` [PATCH v2 4/7] libqos: add MSI-X callbacks to QVirtioPCIDevice Stefan Hajnoczi
2019-10-11 12:23   ` Sergio Lopez
2019-10-17 13:25   ` Thomas Huth
2019-10-11  8:56 ` [PATCH v2 5/7] libqos: expose common virtqueue setup/cleanup functions Stefan Hajnoczi
2019-10-11 12:23   ` Sergio Lopez
2019-10-17 14:13   ` Thomas Huth
2019-10-11  8:56 ` [PATCH v2 6/7] libqos: make the virtio-pci BAR index configurable Stefan Hajnoczi
2019-10-11 12:06   ` Sergio Lopez
2019-10-14  9:52     ` Stefan Hajnoczi
2019-10-14 10:46       ` Sergio Lopez [this message]
2019-10-17 14:27   ` Thomas Huth
2019-10-11  8:56 ` [PATCH v2 7/7] libqos: add VIRTIO PCI 1.0 support Stefan Hajnoczi
2019-10-11 12:24   ` Sergio Lopez
2019-10-17 14:52   ` Thomas Huth
2019-10-17 16:07     ` Stefan Hajnoczi
2019-10-17 16:18       ` Thomas Huth
2019-10-18  6:48         ` Thomas Huth
2019-10-18  6:51           ` Thomas Huth
2019-10-18 10:05           ` Stefan Hajnoczi

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=87imorzjs2.fsf@redhat.com \
    --to=slp@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@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).