From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQZmA-00023a-Jj for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:09:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQZm6-0002bJ-HX for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:09:42 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:34465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQZm6-0002az-66 for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:09:38 -0500 Received: by mail-wm0-x234.google.com with SMTP id 128so114916054wmz.1 for ; Tue, 02 Feb 2016 04:09:37 -0800 (PST) References: <1453130846-14064-1-git-send-email-marcel@redhat.com> <569D2BF5.9050604@redhat.com> <569DEDFE.4000106@redhat.com> From: Marcel Apfelbaum Message-ID: <56B09C7E.1050303@gmail.com> Date: Tue, 2 Feb 2016 14:09:34 +0200 MIME-Version: 1.0 In-Reply-To: <569DEDFE.4000106@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/pci: ensure that only PCI/PCIe bridges can be attached to pxb/pxb-pcie devices Reply-To: marcel@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , Laszlo Ersek , Peter Maydell Cc: QEMU Developers , "Michael S. Tsirkin" On 01/19/2016 10:04 AM, Marcel Apfelbaum wrote: > On 01/18/2016 08:16 PM, Laszlo Ersek wrote: >> On 01/18/16 19:08, Peter Maydell wrote: >>> On 18 January 2016 at 15:27, Marcel Apfelbaum wrote: >>>> PCI devices can't be plugged directly into PCI extra root bridges >>>> because their resources can't be computed by firmware before the ACPI >>>> tables are loaded. >>>> >>>> Signed-off-by: Marcel Apfelbaum >>>> --- >>>> >>>> Hi, >>>> >>>> This patch follows the discussion: >>>> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg01484.html >>> >>> Is it definitely the case that no current working command lines plug >>> PCI devices directly into these things (including on platforms that >>> don't have anything to do with ACPI at all) ? > > Hi, > > The PXB devices can work only on ACPI based platforms, but currently work only on PC Machines. > So for other platforms are out of the scope. > > I understand the issue in putting it generic PCI code, but: > - Non ACPI platforms (implemented in QEMU) do not support extra PCI host bridges (at least yet) > - Even when extra host bridges will be supported, there are are several ways to implement it > and most of them will not require their pxbs to have a parent_device. The presence of a parent device > is a pretty solid lead that is a "snooping bridge" and as far as I know is only typical for the existing solution. > > Now the explanation of the issue we want to solve: > - pxb (PCI expander bridge) - it already has an internal bridge, using > -device pxb,bus80,id=pxb1 -device e1000,bus=pxb1 > will land the device on a built-in pci bridge. > - An incorrect command-line will result in a non working device without the proposed patch. > - pxb-pcie (PCIe Root Complex) - it does not have an internal bridge and trying to use: > -device pxb-pcie,bus80,id=pxb1 -device e1000,bus=pxb1 > will fail. > > This patch ensures non of that can happen. > > Last word: > I did consider another option, adding a "bridges-only" property (defaulted to false) to PCIBus class > and leverage the fact that the pxb internal buses derive from it(and it can be set to true). > > Then we can simply check PCI_BUS_CLASS(bus)->bridges-only but it seemed a little odd since we > don't have that limitation on the real world. > I am not against it, if it is preferred I'll submit a new patch. Ping. Can we merge this patch? Thanks, Marcel > >> >> No clue about "pxb-pcie", but re: "pxb", the documentation and examples >> by Marcel (see: "docs/pci_expander_bridge.txt") will certainly continue >> working, with this patch place. And, that text file is authoritative for >> pxb, since Marcel (et al) wrote the code directly for the purposes >> described in the txt. > > and that reminds me I need to update the doc for pxb-pcie, thanks Laszlo! > Marcel > > >> >> (But I'll let Marcel answer too! :)) >> >> Thanks >> Laszlo >> > >