From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhEfA-0007Zw-7z for qemu-devel@nongnu.org; Tue, 06 Sep 2016 07:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhEf6-0008G8-55 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 07:35:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhEf5-0008Fk-VS for qemu-devel@nongnu.org; Tue, 06 Sep 2016 07:35:32 -0400 Message-ID: <1473161728.31857.20.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 06 Sep 2016 13:35:28 +0200 In-Reply-To: <6c9103e7-70ad-55c6-5533-d6d9bbaa39b4@redhat.com> References: <1472736127-18137-1-git-send-email-marcel@redhat.com> <6c9103e7-70ad-55c6-5533-d6d9bbaa39b4@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH RFC] docs: add PCIe devices placement guidelines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: Marcel Apfelbaum , qemu-devel@nongnu.org, mst@redhat.com, Peter Maydell , Drew Jones , Laine Stump , Andrea Bolognani , Alex Williamson Hi, > > +Plug only legacy PCI devices as Root Complex Integrated Devices > > +even if the PCIe spec does not forbid PCIe devices. >=20 > I suggest "even though the PCI Express spec does not forbid PCI Express > devices as Integrated Devices". (Detail is good!) While talking about integrated devices: There is docs/q35-chipset.cfg, which documents how to mimic q35 with integrated devices as close and complete as possible. Usage: qemu-system-x86_64 -M q35 -readconfig docs/q35-chipset.cfg $args Side note for usb: In practice you don't want to use the tons of uhci/ehci controllers present in the original q35 but plug xhci into one of the pcie root ports instead (unless your guest doesn't support xhci). > > +as required by PCI spec will reserve a 4K IO range for each. > > +The firmware used by QEMU (SeaBIOS/OVMF) will further optimize > > +it by allocation the IO space only if there is at least a device > > +with IO BARs plugged into the bridge. >=20 > This used to be true, but is no longer true, for OVMF. And I think it's > actually correct: we *should* keep the 4K IO reservation per PCI-PCI brid= ge. >=20 > (But, certainly no IO reservation for PCI Express root port, upstream > port, or downstream port! And i'll need your help for telling these > apart in OVMF.) IIRC the same is true for seabios, it looks for the pcie capability and skips io space allocation on pcie ports only. Side note: the linux kernel allocates io space nevertheless, so checking /proc/ioports after boot doesn't tell you what the firmware did. cheers, Gerd