From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z36YL-0007Ov-FZ for qemu-devel@nongnu.org; Thu, 11 Jun 2015 13:46:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z36YH-0003Wv-BR for qemu-devel@nongnu.org; Thu, 11 Jun 2015 13:46:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z36YH-0003V6-5U for qemu-devel@nongnu.org; Thu, 11 Jun 2015 13:46:05 -0400 Message-ID: <5579C959.8020607@redhat.com> Date: Thu, 11 Jun 2015 20:46:01 +0300 From: Marcel Apfelbaum MIME-Version: 1.0 References: <1434029828-31954-1-git-send-email-marcel@redhat.com> <20150611135841.GA7998@morn.localdomain> <55799751.1030904@redhat.com> <20150611142425.GA10763@morn.localdomain> <55799CD6.1060506@redhat.com> <20150611165404.GB20655@morn.localdomain> In-Reply-To: <20150611165404.GB20655@morn.localdomain> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2] pci: fixes to allow booting from extra root pci buses. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: seabios@seabios.org, lersek@redhat.com, qemu-devel@nongnu.org, mst@redhat.com On 06/11/2015 07:54 PM, Kevin O'Connor wrote: > On Thu, Jun 11, 2015 at 05:36:06PM +0300, Marcel Apfelbaum wrote: >> On 06/11/2015 05:24 PM, Kevin O'Connor wrote: >>> On Thu, Jun 11, 2015 at 05:12:33PM +0300, Marcel Apfelbaum wrote: >>>> On 06/11/2015 04:58 PM, Kevin O'Connor wrote: >>>>> On Thu, Jun 11, 2015 at 04:37:08PM +0300, Marcel Apfelbaum wrote: >>>>>> The fixes solves the following issue: >>>>>> The PXB device exposes a new pci root bridge with the >>>>>> fw path: /pci-root@4/..., in which 4 is the root bus number. >>>>>> Before this patch the fw path was wrongly computed: >>>>>> /pci-root@1/pci@i0cf8/... >>>>>> Fix the above issues: Correct the bus number and remove the >>>>>> extra host bridge description. >>>>> >>>>> Why is that wrong? The previous path looks correct to me. >>>> The prev path includes both the extra root bridge and *then* the usual host bridge. >>>> /pci-root@1/pci@i0cf8/ ... >>>> ^ new ^ regular ^ devices >>>> >>>> Since the new pci root bridge (and bus) is on "paralel" with the regular one. >>>> it is not correct to add it to the path. >>>> >>>> The architecture is: >>>> //devices... >>>> /extra root bridge/devices... >>>> /extra root bridge/devices... >>>> And not >>>> /extra root bridge///devices >>> >>> Your patch changed both the "/extra root bridge/devices..." part and >>> the "@1" part. The change of the "@1" in "/pci-root@1/" is not >>> correct IMO. >> Why? @1 should be the unit address which is the text representation >> of the physical address, in our case the slot. Since the bus number >> in our case is 4, I think /pci-root@4/ is the 'correct' address. > > On real machines, the firmware assigns the 4 - it's not a physical > address; it's a logical address (like all bus numbers in PCI). The > firmware might assign a totally different number on the next boot. Now I am confused. Don't get me wrong, I am not an expert on fw, I hardly try to understand it. I looked up a real hardware machine and it seemed to me that the extra pci root numbers are provided in the ACPI tables, meaning by the vendor, not the fw. In this case QEMU is the vendor, i440fx is the machine, right? I am not aware that Seabios/OVMF are deciding the bus numbers for the *PCI roots*. They are doing it for the pci-2-pci bridges of course. I saw that Seabios is trying to "guess" the root-buses by going over all the 0-0xff range and probing all the slots, looking for devices. So it expects the hw to be hardwired regarding PCI root buses. Is my understanding incorrect? Thanks, Marcel > > -Kevin >