From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2zzA-0000gA-8N for qemu-devel@nongnu.org; Thu, 11 Jun 2015 06:45:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2zz7-0005iJ-0d for qemu-devel@nongnu.org; Thu, 11 Jun 2015 06:45:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2zz6-0005iF-Ro for qemu-devel@nongnu.org; Thu, 11 Jun 2015 06:45:20 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 5530ABBB3F for ; Thu, 11 Jun 2015 10:45:20 +0000 (UTC) Message-ID: <557966BC.5000704@redhat.com> Date: Thu, 11 Jun 2015 12:45:16 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1433983083-4636-1-git-send-email-lersek@redhat.com> <1433983083-4636-7-git-send-email-lersek@redhat.com> <55796140.1040403@redhat.com> <55796240.5080802@redhat.com> <557962FA.4010208@redhat.com> In-Reply-To: <557962FA.4010208@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 6/6] hw/pci-bridge: set explicit OFW unit address for TYPE_PXB_HOST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , qemu-devel@nongnu.org Cc: Markus Armbruster , "Michael S. Tsirkin" On 06/11/15 12:29, Marcel Apfelbaum wrote: > On 06/11/2015 01:26 PM, Laszlo Ersek wrote: >> On 06/11/15 12:21, Marcel Apfelbaum wrote: >>> On 06/11/2015 03:38 AM, Laszlo Ersek wrote: >>>> The PXB implementation doesn't allow firmware (SeaBIOS or OVMF) to boot >>>> off devices behind the PXB. This happens because the >>>> sysbus_get_fw_dev_path() function in "hw/core/sysbus.c" doesn't have >>>> enough information to format a unique identifier for the PXB in >>>> question, >>>> and consequently the OpenFirmware device path passed down to the guest >>>> firmware in the "bootorder" fw_cfg file is unusable for identifying the >>>> boot device. >>>> >>>> For example, the command line fragment >>>> >>>> -device pxb,id=bridge1,bus_nr=4 \ >>>> \ >>>> -netdev user,id=netdev0 \ >>>> -device e1000,netdev=netdev0,bus=bridge1,addr=2,bootindex=0 >>>> >>>> results in the following "bootorder" entry: >>>> >>>> /pci/pci-bridge@0/ethernet@2/ethernet-phy@0 >>>> >>>> The initial "pci" node is formatted by sysbus_get_fw_dev_path(), and >>>> the >>>> resultant OpenFirmware device path is independent of bus_nr=4 -- and >>>> therefore it is useless for identifying the device. >>>> >>>> In this patch we change the fw_name device class member of >>>> TYPE_PXB_HOST >>>> from "pci" to "pci-root", and set each instance's explicit OFW unit >>>> address to the PXB bus number. The same command line fragment >>>> results in >>>> the following OpenFirmware device path in the "bootorder" fw_cfg file: >>>> >>>> /pci-root@4/pci-bridge@0/ethernet@2/ethernet-phy@0 >>> Hi Laszlo, >>> >>> I applied your patches but I still get >>> /pci@i0cf8/ethernet@5/ethernet-phy@0 >>> in the boot list >>> >>> I checked and the code enters only once in sysbus_get_fw_dev_path >>> for pci@i0cf8 and goes for pio branch. >>> >>> Do you know maybe what I missed? >> >> I think so, yes: you added the ...,bootorder=N property to a device that >> is *not* behind a PXB. :) You forgot the ...,bus=bridgeX property. > > Actually: > -device pxb,id=bridge1,bus_nr=4 -netdev user,id=u \ > -device > e1000,id=net2,bus=bridge1,netdev=u,addr=0x5,bootindex=0,romfile=../pc-bios/efi-e1000.rom,bus=pci.0 > > > Hmm :( Count the "bus=" substrings on your command line :) Laszlo