audk/OvmfPkg/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
..
AcpiTimerLib OvmfPkg/AcpiTimerLib: list "AcpiTimerLib.h" in the INF files 2018-03-13 14:30:37 +01:00
BaseMemEncryptSevLib OvmfPkg:Fix VS2012 build failure 2018-03-28 09:58:49 +08:00
BasePciCapLib OvmfPkg: introduce PciCapLib 2018-05-24 21:12:06 +02:00
BasePciCapPciSegmentLib OvmfPkg: introduce PciCapPciSegmentLib 2018-05-24 21:13:11 +02:00
DxePciLibI440FxQ35
EmuVariableFvbLib
LoadLinuxLib OvmfPkg/LoadLinuxLib: list "LoadLinuxLib.h" in the INF file 2018-03-13 14:30:41 +01:00
LockBoxLib OvmfPkg/LockBoxLib: list "LockBoxLib.h" in the INF files 2018-03-13 14:30:43 +01:00
NvVarsFileLib OvmfPkg/NvVarsFileLib: list "NvVarsFileLib.h" in the INF file 2018-03-13 14:30:52 +01:00
PciHostBridgeLib OvmfPkg/PciHostBridgeLib: clear PCI aperture vars for (re)init 2018-03-15 08:26:05 +00:00
PlatformBootManagerLib OvmfPkg/PlatformBootManagerLib: process TPM PPI request 2018-05-22 16:30:44 +02:00
PlatformDebugLibIoPort OvmfPkg/PlatformDebugLibIoPort: list "DebugLibDetect.h" in the INF files 2018-03-13 14:30:54 +01:00
PlatformFvbLibNull
PlatformHasIoMmuLib OvmfPkg: Add PlatformHasIoMmuLib 2017-07-10 21:17:28 -07:00
PlatformSecureLib
QemuBootOrderLib OvmfPkg/QemuBootOrderLib: add ConnectDevicesFromQemu() 2018-03-14 11:24:24 +01:00
QemuFwCfgLib OvmfPkg/QemuFwCfgDxeLib: SEV: zero FW_CFG_DMA_ACCESS before decrypting it 2017-08-29 22:44:33 +02:00
QemuFwCfgS3Lib
ResetSystemLib
SerializeVariablesLib OvmfPkg/SerializeVariablesLib: list "SerializeVariablesLib.h" in INF file 2018-03-13 14:30:59 +01:00
SmbiosVersionLib
SmmCpuFeaturesLib OvmfPkg/SmmCpuFeaturesLib: SEV: encrypt+free pages of init. save state map 2018-03-06 13:30:35 +01:00
Tcg2PhysicalPresenceLibNull OvmfPkg: add Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE 2018-05-22 16:30:43 +02:00
Tcg2PhysicalPresenceLibQemu OvmfPkg: add Tcg2PhysicalPresenceLibQemu 2018-05-22 16:30:44 +02:00
TlsAuthConfigLib OvmfPkg/TlsAuthConfigLib: configure trusted cipher suites for HTTPS boot 2018-04-13 14:05:10 +02:00
UefiPciCapPciIoLib OvmfPkg: introduce PciCapPciIoLib 2018-05-24 21:20:42 +02:00
VirtioLib OvmfPkg/VirtioLib: change the parameter of VirtioAppendDesc() to UINT64 2017-08-25 10:42:19 +02:00
VirtioMmioDeviceLib OvmfPkg/VirtioMmioDeviceLib: improve style of mMmioDeviceProtocolTemplate 2018-03-13 14:31:05 +01:00
XenConsoleSerialPortLib
XenHypercallLib OvmfPkg/XenHypercallLib: enable virt extensions for ARM 2017-11-17 09:56:50 +00:00
XenIoMmioLib