qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Number of usable slots in PCIe Root Port / PCIe Switch


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] Number of usable slots in PCIe Root Port / PCIe Switch Downstream Port
Date: Wed, 23 Aug 2017 23:16:27 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 23/08/2017 19:46, Andrea Bolognani wrote:
AFAIK some PCI controllers, particularly:

   * PCIe Root Port (pcie-root-port, ioh3420)
   * PCIe Switch Downstream Port (xio3130-downstream)

only have a single usable slot. libvirt knows about this
fact, and will prevent you from adding more than one
device to the respective bus.

However, as Lukáš recently noticed, QEMU won't complain
if you add more devices:

   $ qemu-system-x86_64 \
     -nodefaults -nographic \
     -M q35 -monitor stdio \
     -device pcie-root-port,id=pci.1 \
     -device virtio-scsi-pci,bus=pci.1 \
     -device virtio-scsi-pci,bus=pci.1
   QEMU 2.9.0 monitor - type 'help' for more information
   (qemu) info qtree
   bus: main-system-bus
     type System
     [...]
     dev: q35-pcihost, id ""
       [...]
       bus: pcie.0
         type PCIE
         dev: pcie-root-port, id "pci.1"
           [...]
           bus: pci.1
             type PCIE
             dev: virtio-scsi-pci, id ""
               [...]
               addr = 01.0
               bus: virtio-bus
                 type virtio-pci-bus
                 dev: virtio-scsi-device, id ""
                   [...]
                   bus: scsi.1
                     type SCSI
             dev: virtio-scsi-pci, id ""
               [...]
               addr = 00.0
               bus: virtio-bus
                 type virtio-pci-bus
                 dev: virtio-scsi-device, id ""
                   [...]
                   bus: scsi.0
                     type SCSI
   (qemu)


Hi Andrea,

As you can see, all devices will show up in the qtree;
only the one with addr=00.0, however, will actually be
visible to the guest OS according to my tests.

Is such a configuration considered valid?

Definitely no.

Should QEMU
complain loudly about it and refuse to start?

Yes, but we need a clean way to do it. Eduardo is working
on a series that would expose to libvirt this info,
Eduardo can you please confirm?

Or should
libvirt and the guest OS / firmware start allowing it?


I thought libvirt does not allow it anyway and yes, is a bug,
but considered low priority.
I personally hoped Eduardo's work can also help in this direction
(classifying PCI Buses, we can add a 'rule' to allow only one
PCIe device per bus.)

But maybe a simple patch preventing QEMU to start would be enough.

Thanks for bringing the issue to my attention,
Marcel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]