* [Qemu-devel] pci: single device at function != 0
@ 2013-11-20 7:39 Alexey Kardashevskiy
2013-11-20 8:04 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2013-11-20 7:39 UTC (permalink / raw)
To: qemu-devel@nongnu.org; +Cc: Nikunj A Dadhania
Hi!
It turned out that it is possible to start QEMU with a single PCI device
placed at 0:0:1.1. I.e. function#1 and there is no function#0. The existing
QEMU only fails if there is function#0 AND the multifunction bit is not set
which is not the case.
Is it supposed to work anywhere (x86 may be)?
In our case SLOF does not scan other functions if there is nothing at
function#0. And the linux kernel does the same thing - it scans other
functions only if sees "multifunction" on function#0.
But I cannot see anywhere in the PCI spec that this configuration is
illegal and must not work. Normally "pseries" guest does not scan PCI and
uses what it gets via the device tree and if we put there devices at
0:0:1.1, it is expected to see the device and work (but not sure).
So - is it a SLOF bug? Or QEMU just does not have right place before
starting the machine to verify that some devices do not have a PCI function
at 0 and print a warning that they won't be detected by the guest? Thanks.
This is the command line example:
./qemu-system-ppc64 \
-trace "events=qemu_trace_events" \
-L "qemu-ppc64-bios/" \
-nographic \
-vga "none" \
-device \
virtio-blk-pci,scsi=off,bus=pci,addr=1.1,drive=drive-virtio-disk53,id=virtio-disk53 \
-drive \
file=virtimg/test1,if=none,id=drive-virtio-disk53,format=qcow2,cache=none \
-S \
-m "2048" \
-machine "pseries" \
-enable-kvm \
-kernel "vml312-probe-pci" \
-initrd "1.cpio"
--
Alexey
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] pci: single device at function != 0
2013-11-20 7:39 [Qemu-devel] pci: single device at function != 0 Alexey Kardashevskiy
@ 2013-11-20 8:04 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2013-11-20 8:04 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: qemu-devel@nongnu.org, Nikunj A Dadhania
On Wed, 2013-11-20 at 18:39 +1100, Alexey Kardashevskiy wrote:
> Hi!
>
> It turned out that it is possible to start QEMU with a single PCI device
> placed at 0:0:1.1. I.e. function#1 and there is no function#0. The existing
> QEMU only fails if there is function#0 AND the multifunction bit is not set
> which is not the case.
>
> Is it supposed to work anywhere (x86 may be)?
Not on normal x86 nor any "real" PCI ... but it does exist in some PAPR
cases, usually old stuff, where pHyp would expose individual functions
to guests.
> In our case SLOF does not scan other functions if there is nothing at
> function#0. And the linux kernel does the same thing - it scans other
> functions only if sees "multifunction" on function#0.
>
> But I cannot see anywhere in the PCI spec that this configuration is
> illegal and must not work. Normally "pseries" guest does not scan PCI and
> uses what it gets via the device tree and if we put there devices at
> 0:0:1.1, it is expected to see the device and work (but not sure).
It is not really a legal configuration
> So - is it a SLOF bug? Or QEMU just does not have right place before
> starting the machine to verify that some devices do not have a PCI function
> at 0 and print a warning that they won't be detected by the guest? Thanks.
>
>
> This is the command line example:
>
> ./qemu-system-ppc64 \
> -trace "events=qemu_trace_events" \
> -L "qemu-ppc64-bios/" \
> -nographic \
> -vga "none" \
> -device \
> virtio-blk-pci,scsi=off,bus=pci,addr=1.1,drive=drive-virtio-disk53,id=virtio-disk53 \
> -drive \
> file=virtimg/test1,if=none,id=drive-virtio-disk53,format=qcow2,cache=none \
> -S \
> -m "2048" \
> -machine "pseries" \
> -enable-kvm \
> -kernel "vml312-probe-pci" \
> -initrd "1.cpio"
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-20 8:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 7:39 [Qemu-devel] pci: single device at function != 0 Alexey Kardashevskiy
2013-11-20 8:04 ` Benjamin Herrenschmidt
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).