public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/6] Abstract allocation of PEI accessible memory
@ 2018-05-22 14:08 Ard Biesheuvel
  2018-05-22 14:08 ` [PATCH 1/6] OvmfPkg/PlatformBootManagerLib: add missing report status code call Ard Biesheuvel
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Ard Biesheuvel @ 2018-05-22 14:08 UTC (permalink / raw)
  To: edk2-devel
  Cc: Ard Biesheuvel, Laszlo Ersek, Leif Lindholm, Michael D Kinney,
	Liming Gao, Star Zeng, Eric Dong, Dandan Bi

At the moment, FirmwarePerformanceTableDataDxe or DxeCorePerformanceLib
are unusable on systems such as AMD Seattle, because they unconditionally
attempt to allocate memory below 4 GB, and ASSERT() if this fails. On AMD
Seattle, no 32-bit addressable DRAM exists, and so the driver will always
assert, and crash a running DEBUG build.

The reason for this is that some platforms (i.e., X64 builds consisting of
a 32-bit PEI stage and 64-bit remaining stages) require these allocations
to be below 4 GB, and for some reason, open coding this practice throughout
the code without regard for other architectures has been regarded as an
acceptable approach.

Instead, I would like to propose the approach implemented in this series:
- create an abstracted EfiAllocatePeiAccessiblePages() routine in UefiLib
  that simply allocates pages from any region on all architectures except
  X64, and allocate below 4 GB for X64
- update the various call sites with calls to this new function.

The above is implemented in patches #3 - #6. Patches #1 and #2 are fixes
for issues that I observed in ArmVirtPkg and OvmfPkg while working on
these patches.

Code can be found here:
https://github.com/ardbiesheuvel/edk2/tree/allocate-pei

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com> 

Ard Biesheuvel (6):
  OvmfPkg/PlatformBootManagerLib: add missing report status code call
  ArmVirtPkg/PlatformBootManagerLib: add missing report status code call
  MdePkg/UefiLib: introduce EfiAllocatePeiAccessiblePages routine
  IntelFrameworkPkg/FrameworkUefiLib: add EfiAllocatePeiAccessiblePages
    routine
  MdeModulePkg/DxeCorePerformanceLib: use EfiAllocatePeiAccessiblePages
  MdeModulePkg/FirmwarePerformanceDataTableDxe: use
    EfiAllocatePeiAccessiblePages

 .../PlatformBootManagerLib.inf                |  1 +
 .../PlatformBootManagerLib/QemuKernel.c       |  4 ++
 .../Library/FrameworkUefiLib/UefiLib.c        | 48 ++++++++++++++++++
 .../DxeCorePerformanceLib.c                   | 45 ++---------------
 .../FirmwarePerformanceDxe.c                  | 50 +++----------------
 MdePkg/Include/Library/UefiLib.h              | 23 +++++++++
 MdePkg/Library/UefiLib/UefiLib.c              | 48 ++++++++++++++++++
 .../PlatformBootManagerLib.inf                |  1 +
 .../PlatformBootManagerLib/QemuKernel.c       |  4 ++
 9 files changed, 141 insertions(+), 83 deletions(-)

-- 
2.17.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-05-23  2:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-22 14:08 [PATCH 0/6] Abstract allocation of PEI accessible memory Ard Biesheuvel
2018-05-22 14:08 ` [PATCH 1/6] OvmfPkg/PlatformBootManagerLib: add missing report status code call Ard Biesheuvel
2018-05-22 18:58   ` Laszlo Ersek
2018-05-22 14:08 ` [PATCH 2/6] ArmVirtPkg/PlatformBootManagerLib: " Ard Biesheuvel
2018-05-22 18:58   ` Laszlo Ersek
2018-05-22 14:08 ` [PATCH 3/6] MdePkg/UefiLib: introduce EfiAllocatePeiAccessiblePages routine Ard Biesheuvel
2018-05-22 17:40   ` Kinney, Michael D
2018-05-22 17:47     ` Ard Biesheuvel
2018-05-22 19:11       ` Laszlo Ersek
2018-05-23  2:02         ` Zeng, Star
2018-05-23  1:59   ` Zeng, Star
2018-05-22 14:08 ` [PATCH 4/6] IntelFrameworkPkg/FrameworkUefiLib: add " Ard Biesheuvel
2018-05-22 14:08 ` [PATCH 5/6] MdeModulePkg/DxeCorePerformanceLib: use EfiAllocatePeiAccessiblePages Ard Biesheuvel
2018-05-22 14:08 ` [PATCH 6/6] MdeModulePkg/FirmwarePerformanceDataTableDxe: " Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox