audk/OvmfPkg/Include/Library
Laszlo Ersek 02b9a8343f OvmfPkg: introduce PciCapPciIoLib
Add a library class, and a UEFI_DRIVER lib instance, that are layered on
top of PciCapLib, and allow clients to plug an EFI_PCI_IO_PROTOCOL backend
into PciCapLib, for config space access.

(Side note:

Although the UEFI spec says that EFI_PCI_IO_PROTOCOL_CONFIG() returns
EFI_UNSUPPORTED if "[t]he address range specified by Offset, Width, and
Count is not valid for the PCI configuration header of the PCI
controller", this patch doesn't directly document the EFI_UNSUPPORTED
error code, for ProtoDevTransferConfig() and its callers
ProtoDevReadConfig() and ProtoDevWriteConfig(). Instead, the patch refers
to "unspecified error codes". The reason is that in edk2, the
PciIoConfigRead() and PciIoConfigWrite() functions [1] can also return
EFI_INVALID_PARAMETER for the above situation.

Namely, PciIoConfigRead() and PciIoConfigWrite() first call
PciIoVerifyConfigAccess(), which indeed produces the standard
EFI_UNSUPPORTED error code, if the device's config space is exceeded.
However, if PciIoVerifyConfigAccess() passes, and we reach
RootBridgeIoPciRead() and RootBridgeIoPciWrite() [2], then
RootBridgeIoCheckParameter() can still fail, e.g. if the root bridge
doesn't support extended config space (see commit 014b472053).

For all kinds of Limit violations in IO, MMIO, and config space,
RootBridgeIoCheckParameter() returns EFI_INVALID_PARAMETER, not
EFI_UNSUPPORTED. That error code is then propagated up to, and out of,
PciIoConfigRead() and PciIoConfigWrite().

[1] MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
[2] MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-05-24 21:20:42 +02:00
..
LoadLinuxLib.h OvmfPkg: Fix typing errors in header files 2016-09-13 14:14:31 +02:00
MemEncryptSevLib.h OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map 2018-03-06 13:30:30 +01:00
NvVarsFileLib.h Update the copyright notice format 2010-04-28 12:43:04 +00:00
PciCapLib.h OvmfPkg: introduce PciCapLib 2018-05-24 21:12:06 +02:00
PciCapPciIoLib.h OvmfPkg: introduce PciCapPciIoLib 2018-05-24 21:20:42 +02:00
PciCapPciSegmentLib.h OvmfPkg: introduce PciCapPciSegmentLib 2018-05-24 21:13:11 +02:00
PlatformFvbLib.h OvmfPkg EMU FVB: Add 2 functions to PlatformFvbLib 2011-01-09 03:51:16 +00:00
QemuBootOrderLib.h OvmfPkg/QemuBootOrderLib: add ConnectDevicesFromQemu() 2018-03-14 11:24:24 +01:00
QemuFwCfgLib.h ArmVirtPkg, OvmfPkg: retire QemuFwCfgS3Enabled() from QemuFwCfgLib 2017-03-14 21:49:16 +01:00
QemuFwCfgS3Lib.h OvmfPkg/QemuFwCfgS3Lib: Fix VS tool chain build failure 2017-03-15 21:18:40 -07:00
SerializeVariablesLib.h OvmfPkg: Add SerializeVariablesLib library class 2011-01-30 19:49:37 +00:00
VirtioLib.h OvmfPkg/VirtioLib: change the parameter of VirtioAppendDesc() to UINT64 2017-08-25 10:42:19 +02:00
VirtioMmioDeviceLib.h OvmfPkg/VirtioMmioDeviceLib: Implement VIRTIO_DEVICE_PROTOCOL for VirtIo Devices over MMIO 2013-12-11 16:57:59 +00:00
XenHypercallLib.h OvmfPkg/XenHypercallLib: Add EFIAPI 2016-12-06 18:00:32 +01:00
XenIoMmioLib.h ArmVirtualizationPkg: add XenIoMmioLib 2015-02-28 20:34:16 +00:00