public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@lists.01.org>
Cc: Marcel Apfelbaum <marcel@redhat.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: Re: [PATCH 0/7] OvmfPkg/PciHotPlugInitDxe: obey PCI resource reservation hints from QEMU
Date: Tue, 3 Oct 2017 16:09:49 +0200	[thread overview]
Message-ID: <0483db69-735b-fce7-587c-cb694074ee30@redhat.com> (raw)
In-Reply-To: <20170925195824.10866-1-lersek@redhat.com>

On 09/25/17 21:58, Laszlo Ersek wrote:
> Repo:   https://github.com/lersek/edk2.git
> Branch: pci_resource_reserve
> 
> "OvmfPkg/PciHotPlugInitDxe" implements EFI_PCI_HOT_PLUG_INIT_PROTOCOL
> from the PI spec. Currently it returns fixed resource reservations (512B
> IO space and 2MB non-prefetchable 32-bit MMIO space) for all bridges.
> This is not flexible enough:
> 
> (1) For PCI Express bridges (such as root ports and downstream ports),
> reserving any IO space is wasteful, and limits the number of ports.
> (This is because each such port can only accept one (multi-function)
> device, and because the 512B reservation is rounded up to 4KB, and
> because the IO space under OVMF/Q35 consists of 10 * 4KB.)
> 
> (2) For hot-plugging PCI Express devices with large MMIO BARs into such
> ports, the reservation of only 2MB MMIO (and even that limited to
> non-prefetchable, hence 32-bit, address space) is insufficient.
> 
> QEMU has recently gained the ability to control these reservation sizes
> on the command line. At this point the hints are only supported for the
> "pcie-root-port" device -- which implies the Q35 machine type, given
> that i440fx only supports conventional PCI, not PCI Express --, with the
> following properties:
> 
> - pcie-root-port.bus-reserve=uint32
> - pcie-root-port.io-reserve=size
> - pcie-root-port.mem-reserve=size
> - pcie-root-port.pref32-reserve=size
> - pcie-root-port.pref64-reserve=size
> 
> The hints are exposed to the guest in the conventional config space of
> the device, using a vendor-specific capability (which is documented in
> the QEMU source tree; see all references in the individual patches). It
> is expected that, if any future hotplug controllers in QEMU gain the
> same ability, they will reuse the mechanism identically.
> 
> This series generally implements the parsing of this capability in
> OvmfPkg/PciHotPlugInitDxe, and the translation thereof to the ACPI
> address space descriptor format that the Platform Init spec defines for
> EFI_PCI_HOT_PLUG_INIT_PROTOCOL.GetResourcePadding().
> 
> The first patch is for "MdePkg/IndustryStandard"; it introduces the
> vendor-specific capability header, from the PCI 2.3 spec. The rest of
> the patches is for OvmfPkg.
> 
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (7):
>   MdePkg/IndustryStandard/Pci23: add vendor-specific capability header
>   OvmfPkg/IndustryStandard: define PCI Capabilities for QEMU's PCI
>     Bridges
>   OvmfPkg/PciHotPlugInitDxe: clean up protocol usage comment
>   OvmfPkg/PciHotPlugInitDxe: clean up addr. range for non-prefetchable
>     MMIO
>   OvmfPkg/PciHotPlugInitDxe: generalize RESOURCE_PADDING composition
>   OvmfPkg/PciHotPlugInitDxe: add helper functions for setting up
>     paddings
>   OvmfPkg/PciHotPlugInitDxe: translate QEMU's resource reservation hints
> 
>  MdePkg/Include/IndustryStandard/Pci23.h                      |  10 +
>  OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h |  60 ++
>  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c                   | 661 ++++++++++++++++++--
>  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf                 |   6 +-
>  4 files changed, 674 insertions(+), 63 deletions(-)
>  create mode 100644 OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h
> 

Thanks All for the feedback, pushed as commit range
9425b34925d0..fe4049471bdf.

Laszlo


      parent reply	other threads:[~2017-10-03 14:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 19:58 [PATCH 0/7] OvmfPkg/PciHotPlugInitDxe: obey PCI resource reservation hints from QEMU Laszlo Ersek
2017-09-25 19:58 ` [PATCH 1/7] MdePkg/IndustryStandard/Pci23: add vendor-specific capability header Laszlo Ersek
2017-09-27  6:26   ` Gao, Liming
2017-09-25 19:58 ` [PATCH 2/7] OvmfPkg/IndustryStandard: define PCI Capabilities for QEMU's PCI Bridges Laszlo Ersek
2017-09-25 19:58 ` [PATCH 3/7] OvmfPkg/PciHotPlugInitDxe: clean up protocol usage comment Laszlo Ersek
2017-09-25 19:58 ` [PATCH 4/7] OvmfPkg/PciHotPlugInitDxe: clean up addr. range for non-prefetchable MMIO Laszlo Ersek
2017-09-25 19:58 ` [PATCH 5/7] OvmfPkg/PciHotPlugInitDxe: generalize RESOURCE_PADDING composition Laszlo Ersek
2017-09-25 19:58 ` [PATCH 6/7] OvmfPkg/PciHotPlugInitDxe: add helper functions for setting up paddings Laszlo Ersek
2017-09-25 19:58 ` [PATCH 7/7] OvmfPkg/PciHotPlugInitDxe: translate QEMU's resource reservation hints Laszlo Ersek
2017-10-02 17:43   ` Jordan Justen
2017-10-02 20:00     ` Laszlo Ersek
2017-10-03 14:09 ` Laszlo Ersek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0483db69-735b-fce7-587c-cb694074ee30@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox