[edk2] [PATCH v2 0/7] OvmfPkg, ArmVirtPkg: add and use PCI(E) Capabilities Library

Laszlo Ersek posted 7 patches 5 years, 11 months ago
Failed in applying to current master (apply log)
ArmVirtPkg/ArmVirt.dsc.inc                                          |    3 +
OvmfPkg/Include/IndustryStandard/Virtio10.h                         |    7 +-
OvmfPkg/Include/Library/PciCapLib.h                                 |  429 +++++++++
OvmfPkg/Include/Library/PciCapPciIoLib.h                            |   58 ++
OvmfPkg/Include/Library/PciCapPciSegmentLib.h                       |   82 ++
OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c                       | 1007 ++++++++++++++++++++
OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h                       |   60 ++
OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf                     |   38 +
OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c   |  226 +++++
OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h   |   47 +
OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf |   35 +
OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c             |  243 +++++
OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h             |   44 +
OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf           |   36 +
OvmfPkg/OvmfPkg.dec                                                 |   14 +
OvmfPkg/OvmfPkgIa32.dsc                                             |    3 +
OvmfPkg/OvmfPkgIa32X64.dsc                                          |    3 +
OvmfPkg/OvmfPkgX64.dsc                                              |    3 +
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c                          |  267 ++----
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf                        |    5 +
OvmfPkg/Virtio10Dxe/Virtio10.c                                      |  135 +--
OvmfPkg/Virtio10Dxe/Virtio10.inf                                    |    2 +
22 files changed, 2485 insertions(+), 262 deletions(-)
create mode 100644 OvmfPkg/Include/Library/PciCapLib.h
create mode 100644 OvmfPkg/Include/Library/PciCapPciIoLib.h
create mode 100644 OvmfPkg/Include/Library/PciCapPciSegmentLib.h
create mode 100644 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
create mode 100644 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h
create mode 100644 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
create mode 100644 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c
create mode 100644 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h
create mode 100644 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
create mode 100644 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c
create mode 100644 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h
create mode 100644 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
[edk2] [PATCH v2 0/7] OvmfPkg, ArmVirtPkg: add and use PCI(E) Capabilities Library
Posted by Laszlo Ersek 5 years, 11 months ago
Repo:   https://github.com/lersek/edk2.git
Branch: pci_cap_v2

In v2, the new libs are initially introduced under OvmfPkg, rather than
MdePkg. v1 was posted at
<http://mid.mail-archive.com/20180504213637.11266-1-lersek@redhat.com>.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>

Thanks,
Laszlo

Laszlo Ersek (7):
  OvmfPkg: introduce PciCapLib
  OvmfPkg: introduce PciCapPciSegmentLib
  OvmfPkg: introduce PciCapPciIoLib
  OvmfPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLib
  ArmVirtPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLib
  OvmfPkg/PciHotPlugInitDxe: convert to PciCapLib
  OvmfPkg/Virtio10Dxe: convert to PciCapLib

 ArmVirtPkg/ArmVirt.dsc.inc                                          |    3 +
 OvmfPkg/Include/IndustryStandard/Virtio10.h                         |    7 +-
 OvmfPkg/Include/Library/PciCapLib.h                                 |  429 +++++++++
 OvmfPkg/Include/Library/PciCapPciIoLib.h                            |   58 ++
 OvmfPkg/Include/Library/PciCapPciSegmentLib.h                       |   82 ++
 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c                       | 1007 ++++++++++++++++++++
 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h                       |   60 ++
 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf                     |   38 +
 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c   |  226 +++++
 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h   |   47 +
 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf |   35 +
 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c             |  243 +++++
 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h             |   44 +
 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf           |   36 +
 OvmfPkg/OvmfPkg.dec                                                 |   14 +
 OvmfPkg/OvmfPkgIa32.dsc                                             |    3 +
 OvmfPkg/OvmfPkgIa32X64.dsc                                          |    3 +
 OvmfPkg/OvmfPkgX64.dsc                                              |    3 +
 OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c                          |  267 ++----
 OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf                        |    5 +
 OvmfPkg/Virtio10Dxe/Virtio10.c                                      |  135 +--
 OvmfPkg/Virtio10Dxe/Virtio10.inf                                    |    2 +
 22 files changed, 2485 insertions(+), 262 deletions(-)
 create mode 100644 OvmfPkg/Include/Library/PciCapLib.h
 create mode 100644 OvmfPkg/Include/Library/PciCapPciIoLib.h
 create mode 100644 OvmfPkg/Include/Library/PciCapPciSegmentLib.h
 create mode 100644 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
 create mode 100644 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h
 create mode 100644 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
 create mode 100644 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c
 create mode 100644 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h
 create mode 100644 OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
 create mode 100644 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c
 create mode 100644 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h
 create mode 100644 OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf

-- 
2.14.1.3.gb7cf6e02401b

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2 0/7] OvmfPkg, ArmVirtPkg: add and use PCI(E) Capabilities Library
Posted by Laszlo Ersek 5 years, 11 months ago
On 05/23/18 22:21, Laszlo Ersek wrote:
> Repo:   https://github.com/lersek/edk2.git
> Branch: pci_cap_v2
>
> In v2, the new libs are initially introduced under OvmfPkg, rather
> than MdePkg. v1 was posted at
> <http://mid.mail-archive.com/20180504213637.11266-1-lersek@redhat.com>.
>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Jordan Justen <jordan.l.justen@intel.com>

I've addressed Ard's requests with the following (cumulative) diff:

> diff --git a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> index 6789359f0a54..c059264b322d 100644
> --- a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> +++ b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
> @@ -874,6 +874,8 @@ PciCapGetInfo (
>  {
>    PCI_CAP *InstanceZero;
>
> +  ASSERT (Info != NULL);
> +
>    InstanceZero = (Cap->Key.Instance == 0 ? Cap :
>                    Cap->NumInstancesUnion.InstanceZero);
>
> diff --git a/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c
> b/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c
> index 84369e4dc3a8..358d87f93103 100644
> --- a/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c
> +++ b/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.c
> @@ -73,10 +73,10 @@ ProtoDevTransferConfig (
>      // possible in one iteration of the loop. Otherwise, transfer only one
>      // unit, to improve the alignment.
>      //
> -    if (Size >= BIT2 && (ConfigOffset & (BIT2 - 1)) == 0) {
> +    if (Size >= 4 && (ConfigOffset & 3) == 0) {
>        Width = EfiPciIoWidthUint32;
>        Count = Size >> Width;
> -    } else if (Size >= BIT1 && (ConfigOffset & (BIT1 - 1)) == 0) {
> +    } else if (Size >= 2 && (ConfigOffset & 1) == 0) {
>        Width = EfiPciIoWidthUint16;
>        Count = 1;
>      } else {

After retesting the series, I pushed it as commit range
4b8552d794e7..5685a243b6f8.

I've also filed <https://bugzilla.tianocore.org/show_bug.cgi?id=957>
about upstreaming the libraries from the first three patches to a more
central package.

Thanks!
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel