Received: from eggs.gnu.org ([2001:4830:134:3::10]:51943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzmqv-0007XX-KD for qemu-devel@nongnu.org; Thu, 27 Oct 2016 11:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzmqs-0006ut-GZ for qemu-devel@nongnu.org; Thu, 27 Oct 2016 11:44:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzmqs-0006u5-8L for qemu-devel@nongnu.org; Thu, 27 Oct 2016 11:44:22 -0400 References: <1476366759-29119-1-git-send-email-marcel@redhat.com> <38124233-a3e5-9073-262e-e7ef96676eea@redhat.com> <5880f354-9f1e-a9cf-9728-5ac5168ef9c9@redhat.com> <26cb483f-9eeb-43ad-2162-2f50389587c8@redhat.com> From: Laszlo Ersek Message-ID: <1aba4e19-53b8-e4fe-144b-7e8335e6c7b2@redhat.com> Date: Thu, 27 Oct 2016 17:44:17 +0200 MIME-Version: 1.0 In-Reply-To: <26cb483f-9eeb-43ad-2162-2f50389587c8@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2 RESEND] docs: add PCIe devices placement guidelines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , qemu-devel@nongnu.org Cc: Peter Maydell , Andrew Jones , "Michael S. Tsirkin" , Andrea Bolognani , Alex Williamson , Gerd Hoffmann , Laine Stump On 10/27/16 13:27, Marcel Apfelbaum wrote: > On 10/14/2016 02:36 PM, Laszlo Ersek wrote: >> On 10/13/16 16:05, Marcel Apfelbaum wrote: >>> On 10/13/2016 04:52 PM, Marcel Apfelbaum wrote: >>>> + -device >>>> pci-bridge,id=pci_bridge1,bus=dmi_pci_bridge1[,chassis_nr=x][,addr=y] >>>> \ >>>> + -device ,bus=pci_bridge1[,addr=x] >> >> {13} It would be nice to spell out the valid device addresses (y and x) >> here too -- can we use 0 for them? SHPC again? >> >> Can we / should we simply go with >=1 device addresses? >> > > For pci-bridges only - yes. A better idea (I think) is to disable SHPC > by default > from the next QEMU version. Make this slot usable. Sounds OK? Sure. >>>> + Don't use PCI Express Switches if you don't have too, they use >>>> + an extra PCI bus that may handy to plug another device id it >>>> comes to it. >>>> + >> >> {25} I'd put it as: Don't use PCI Express Switches if you don't have >> too, each one of those uses an extra PCI bus (for its Upstream Port) >> that could be put to better use with another Root Port or Downstream >> Port, which may come handy for hotplugging another device. >> >> {26} Another remark (important to me) in this section: the document >> doesn't state firmware expectations. It's clear the firmware is expected >> to reserve no IO space for PCI Express Downstream Ports and Root Ports, >> but what about MMIO? >> >> We discussed this at length with Alex, but I think we didn't conclude >> anything. It would be nice if firmware received some instructions from >> this document in this regard, even before we implement our own ports and >> bridges in QEMU. >> > > Hmm, I have no idea what to add here, except: > The firmware is expected to reserve at least 2M for each pci bridge? Just ignore {26} for now please. I'll come back to this later when we have our own (generic) ports. >>>> +5.3 Hot plug example: >>>> +Using HMP: (add -monitor stdio to QEMU command line) >>>> + device_add ,id=,bus=>>> Id/PCI-PCI bridge Id/pxb-pcie Id> >> >> {27} I think the bus=<...> part is incorrect here. Based on the rest of >> the guidelines, we have to specify the ID of: >> - a PCI Express Root Port, or >> - a PCI Express Downstream Port, or >> - a PCI-PCI bridge. >> > > I don't get it, you specify what you wrote above as the bus, right? > For example if you start the machine with > .... -device ioh3420,id=root_port1, > you hotplug with: device_add e1000,bus=root_port1. My point is that your example names bus= which suggests that the following bus *types* can receive hotplugged devices: (a) main root bus ("pcie.0") (c) root port ("PCI Express Root Port Id") (c) PCI-PCI bridge ("PCI-PCI bridge Id") (d) extra root bus ("pxb-pcie Id") Based on the rest of the guidelines, suggestions (a) and (d) are invalid -- those bus types cannot accept hotplugged devices --, plus option (e) is missing, namely: (e) downstream port. In other words, your example IDs *infer* bus types, and the set of bus types inferred is both wrong (incorrect elements) and incomplete (one correct element missing). Therefore my proposal is to provide the following example: bus= That's all. Cheers Laszlo