From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj2mX-0002jQ-0e for qemu-devel@nongnu.org; Wed, 20 Nov 2013 03:05:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj2mR-0004Bn-2H for qemu-devel@nongnu.org; Wed, 20 Nov 2013 03:05:04 -0500 Received: from gate.crashing.org ([63.228.1.57]:36380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj2mQ-0004BJ-PI for qemu-devel@nongnu.org; Wed, 20 Nov 2013 03:04:58 -0500 Message-ID: <1384934690.26969.87.camel@pasglop> From: Benjamin Herrenschmidt Date: Wed, 20 Nov 2013 19:04:50 +1100 In-Reply-To: <528C6725.2070605@ozlabs.ru> References: <528C6725.2070605@ozlabs.ru> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] pci: single device at function != 0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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" > > >