qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: ehabkost@redhat.com, marcel@redhat.com, mst@redhat.com,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org, lersek@redhat.com
Subject: Re: [Qemu-devel] [RFC for-2.10 3/3] pseries: Allow PCIe virtio and XHCI on pseries machine type
Date: Wed, 29 Mar 2017 15:07:13 +1100	[thread overview]
Message-ID: <20170329040713.GU21068@umbus.fritz.box> (raw)
In-Reply-To: <72226418-5022-1ccc-9af4-6fce295db7d4@ozlabs.ru>

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

On Wed, Mar 29, 2017 at 01:20:50PM +1100, Alexey Kardashevskiy wrote:
> On 28/03/17 13:16, David Gibson wrote:
> > pseries now allows PCIe devices (both emulated and VFIO), although its
> > PCI bus is in most respects a plain PCI bus - this uses paravirtualized
> > access methods to PCIe extended config space defined in the PAPR spec.
> > 
> > However, because the bus is not PCIe, it means that virtio-pci and XHCI
> > devices will present themselves as plain PCI rather than PCIe, which would
> > be preferable.
> > 
> > This patch uses the new hook to override the behaviour for such PCI/PCIe
> > "hybrid" devices to allow PCIe virtio-pci and XHCI on pseries.
> 
> 
> Not clear what all these tests/virtio-*.c changes are for and why here -
> does "make check" break if you do not enforce disable-legacy=off?

Yes it does.  There's an explanation in the 0/3 message.

> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> >  hw/ppc/spapr_pci.c       | 9 +++++++++
> >  tests/virtio-9p-test.c   | 2 +-
> >  tests/virtio-blk-test.c  | 4 ++--
> >  tests/virtio-net-test.c  | 2 +-
> >  tests/virtio-scsi-test.c | 2 +-
> >  5 files changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> > index 98c52e4..7686f7f 100644
> > --- a/hw/ppc/spapr_pci.c
> > +++ b/hw/ppc/spapr_pci.c
> > @@ -1979,6 +1979,14 @@ static const char *spapr_phb_root_bus_path(PCIHostState *host_bridge,
> >      return sphb->dtbusname;
> >  }
> >  
> > +static bool spapr_phb_allow_hybrid_pcie(PCIHostState *host_bridge,
> > +                                        PCIDevice *pci_dev)
> > +{
> > +    sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(host_bridge);
> > +
> > +    return sphb->pcie_ecs;
> > +}
> > +
> >  static void spapr_phb_class_init(ObjectClass *klass, void *data)
> >  {
> >      PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);
> > @@ -1986,6 +1994,7 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data)
> >      HotplugHandlerClass *hp = HOTPLUG_HANDLER_CLASS(klass);
> >  
> >      hc->root_bus_path = spapr_phb_root_bus_path;
> > +    hc->allow_hybrid_pcie = spapr_phb_allow_hybrid_pcie;
> >      dc->realize = spapr_phb_realize;
> >      dc->props = spapr_phb_properties;
> >      dc->reset = spapr_phb_reset;
> > diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
> > index 43a1ad8..ae0d51e 100644
> > --- a/tests/virtio-9p-test.c
> > +++ b/tests/virtio-9p-test.c
> > @@ -32,7 +32,7 @@ static QVirtIO9P *qvirtio_9p_start(const char *driver)
> >  {
> >      const char *arch = qtest_get_arch();
> >      const char *cmd = "-fsdev local,id=fsdev0,security_model=none,path=%s "
> > -                      "-device %s,fsdev=fsdev0,mount_tag=%s";
> > +                      "-device %s,fsdev=fsdev0,mount_tag=%s,disable-legacy=off";
> >      QVirtIO9P *v9p = g_new0(QVirtIO9P, 1);
> >  
> >      v9p->test_share = g_strdup("/tmp/qtest.XXXXXX");
> > diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
> > index 1eee95d..5fb7882 100644
> > --- a/tests/virtio-blk-test.c
> > +++ b/tests/virtio-blk-test.c
> > @@ -65,7 +65,7 @@ static QOSState *pci_test_start(void)
> >      const char *cmd = "-drive if=none,id=drive0,file=%s,format=raw "
> >                        "-drive if=none,id=drive1,file=/dev/null,format=raw "
> >                        "-device virtio-blk-pci,id=drv0,drive=drive0,"
> > -                      "addr=%x.%x";
> > +                      "addr=%x.%x,disable-legacy=off";
> >  
> >      tmp_path = drive_create();
> >  
> > @@ -656,7 +656,7 @@ static void pci_hotplug(void)
> >  
> >      /* plug secondary disk */
> >      qpci_plug_device_test("virtio-blk-pci", "drv1", PCI_SLOT_HP,
> > -                          "'drive': 'drive1'");
> > +                          "'drive': 'drive1', 'disable-legacy': 'off'");
> >  
> >      dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT_HP);
> >      g_assert(dev);
> > diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
> > index 8f94360..a35d87b 100644
> > --- a/tests/virtio-net-test.c
> > +++ b/tests/virtio-net-test.c
> > @@ -55,7 +55,7 @@ static QOSState *pci_test_start(int socket)
> >  {
> >      const char *arch = qtest_get_arch();
> >      const char *cmd = "-netdev socket,fd=%d,id=hs0 -device "
> > -                      "virtio-net-pci,netdev=hs0";
> > +                      "virtio-net-pci,netdev=hs0,disable-legacy=off";
> >  
> >      if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> >          return qtest_pc_boot(cmd, socket);
> > diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
> > index 0eabd56..5a802d9 100644
> > --- a/tests/virtio-scsi-test.c
> > +++ b/tests/virtio-scsi-test.c
> > @@ -36,7 +36,7 @@ static QOSState *qvirtio_scsi_start(const char *extra_opts)
> >  {
> >      const char *arch = qtest_get_arch();
> >      const char *cmd = "-drive id=drv0,if=none,file=/dev/null,format=raw "
> > -                      "-device virtio-scsi-pci,id=vs0 "
> > +                      "-device virtio-scsi-pci,id=vs0,disable-legacy=off "
> >                        "-device scsi-hd,bus=vs0.0,drive=drv0 %s";
> >  
> >      if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> > 
> 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

  reply	other threads:[~2017-03-29  4:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28  2:16 [Qemu-devel] [RFC for-2.10 0/3] Rework handling of PCI/PCIe "hybrid" devices David Gibson
2017-03-28  2:16 ` [Qemu-devel] [RFC for-2.10 1/3] pci/pcie: Make a consistent helper for switching " David Gibson
2017-04-19 17:48   ` Marcel Apfelbaum
2017-04-26 15:23   ` Michael S. Tsirkin
2017-05-01  6:53     ` David Gibson
2017-08-29 11:42     ` David Gibson
2017-08-29 14:12       ` Eduardo Habkost
2017-08-30  5:54         ` David Gibson
2017-08-30 12:23           ` Eduardo Habkost
2017-09-26  5:04             ` David Gibson
2017-03-28  2:16 ` [Qemu-devel] [RFC for-2.10 2/3] pci: Allow host bridges to override PCI/PCIe hybrid device behaviour David Gibson
2017-04-17 18:30   ` Eduardo Habkost
2017-04-18  2:21     ` David Gibson
2017-04-18 14:33       ` Eduardo Habkost
2017-04-19 18:04         ` Marcel Apfelbaum
2017-04-26 15:29   ` Michael S. Tsirkin
2017-05-01  6:56     ` David Gibson
2017-09-28  7:53     ` David Gibson
2017-03-28  2:16 ` [Qemu-devel] [RFC for-2.10 3/3] pseries: Allow PCIe virtio and XHCI on pseries machine type David Gibson
2017-03-29  2:20   ` Alexey Kardashevskiy
2017-03-29  4:07     ` David Gibson [this message]
2017-08-29 13:01 ` [Qemu-devel] [RFC for-2.10 0/3] Rework handling of PCI/PCIe "hybrid" devices Eduardo Habkost

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=20170329040713.GU21068@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=aik@ozlabs.ru \
    --cc=ehabkost@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).