From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj2Nm-0002Gw-MU for qemu-devel@nongnu.org; Wed, 20 Nov 2013 02:39:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj2Nf-0005D5-4s for qemu-devel@nongnu.org; Wed, 20 Nov 2013 02:39:30 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:56065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj2Ne-0005C8-St for qemu-devel@nongnu.org; Wed, 20 Nov 2013 02:39:23 -0500 Received: by mail-pd0-f179.google.com with SMTP id r10so6303521pdi.38 for ; Tue, 19 Nov 2013 23:39:21 -0800 (PST) Message-ID: <528C6725.2070605@ozlabs.ru> Date: Wed, 20 Nov 2013 18:39:17 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] pci: single device at function != 0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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