public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 00/15] ArmVirtPkg: get rid of ArmPlatformLib
@ 2017-11-17 16:08 Ard Biesheuvel
  2017-11-17 16:08 ` [PATCH 01/15] ArmPlatformPkg/ArmPlatformLibNull: remove bogus PCD dependencies Ard Biesheuvel
                   ` (14 more replies)
  0 siblings, 15 replies; 43+ messages in thread
From: Ard Biesheuvel @ 2017-11-17 16:08 UTC (permalink / raw)
  To: edk2-devel, lersek; +Cc: leif.lindholm, Ard Biesheuvel

ArmPlatformLib is a mixed bag of platform specific hooks, some of which
are called from early startup code, and some of which are called from C
code, to get the boot mode, memory layout etc.

This library class is tightly coupled to the old ARM implementations that
ran some parts of UEFI in the secure world, and booted all cores into SEC.
Also, the fact that both PrePi and PrePeiCore use ArmPlatformLib makes it
difficult to use PEI phase features such as PPI depexes. It would be better
if we could get rid of it completely, or at least not require each platform
to implement it in its entirety.

So as a first step towards phasing out ArmPlatformLib to the extent possible,
let's remove it from ArmVirtPkg. For ArmVirtXen and ArmVirtQemuKernel, we can
get rid of it completely. For ArmVirtQemu, we can't, but we can still remove
our own implementation by switching to the NULL implementation from
ArmPlatformPkg (which does require a minimal tweak in patch #1). Further
reductions of the scope of ArmPlatformLib will be reflected in that library
without the need for further changes to ArmVirtPkg.

Note to Laszlo: given that you care very little about the Xen and QemuKernel
flavors, please feel free to focus primarily on patches 9 - 15.

https://github.com/ardbiesheuvel/edk2/tree/armvirtpkg-armplatformlib-removal

Ard Biesheuvel (15):
  ArmPlatformPkg/ArmPlatformLibNull: remove bogus PCD dependencies
  ArmVirtPkg/PrePi: run all library constructors by hand
  ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function
  ArmVirtPkg/PrePi: remove bogus primary core check
  ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib
  ArmVirtPkg/PrePi: move DRAM discovery code into PrePi
  ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency
  ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency
  ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings
  ArmVirtPkg: introduce ArmVirtMemInfoLib library class
  ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation
  ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation
  ArmVirtPkg: implement ArmVirtMemInfo PPI, PEIM and library
  ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib
  ArmVirtPkg: remove ArmPlatformLib implementations

 ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf                                            |   3 -
 ArmVirtPkg/ArmVirt.dsc.inc                                                                                  |   1 -
 ArmVirtPkg/ArmVirtPkg.dec                                                                                   |   6 +
 ArmVirtPkg/ArmVirtQemu.dsc                                                                                  |   7 +-
 ArmVirtPkg/ArmVirtQemu.fdf                                                                                  |   1 +
 ArmVirtPkg/ArmVirtQemuKernel.dsc                                                                            |   2 +-
 ArmVirtPkg/ArmVirtXen.dsc                                                                                   |   2 +-
 ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h                                                              |  39 ++++++
 ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h                                                                     |  48 +++++++
 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S                            | 141 --------------------
 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S                                | 123 -----------------
 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf                          |  64 ---------
 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c                                          |  70 ----------
 ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c                                        |   4 +-
 ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf                                      |   3 +-
 ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S                                                      |  57 --------
 ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm                                                    |  71 ----------
 ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf                                                |  64 ---------
 ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c                                                             | 113 ----------------
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S                             | 140 -------------------
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S                                 | 123 -----------------
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf                            |  63 ---------
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c                                                 |  89 ------------
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c                                           |  70 ----------
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c                                                |  82 ------------
 ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c                                                    |  46 +++++++
 ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf                                                  |  42 ++++++
 ArmVirtPkg/Library/{ArmVirtPlatformLib/AARCH64/VirtHelper.S => QemuVirtMemInfoLib/AArch64/PhysAddrTop.S}    |  33 +----
 ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S                                                     |  24 ++++
 ArmVirtPkg/Library/{ArmQemuRelocatablePlatformLib/QemuVirtMem.c => QemuVirtMemInfoLib/QemuVirtMemInfoLib.c} |  61 ++++-----
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf                                                |  53 ++++++++
 ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S                                                  |  39 ++++++
 ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S                                                      |  24 ++++
 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c                                                    |  61 +++++++++
 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf                                                  |  41 ++++++
 ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S                                                                 |  98 +++++++++++---
 ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S                                                                     |  92 ++++++++++---
 ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf                                                         |   5 +-
 ArmVirtPkg/{Library/ArmQemuRelocatablePlatformLib => PrePi}/FdtParser.c                                     |   0
 ArmVirtPkg/PrePi/PrePi.c                                                                                    |  43 +-----
 ArmVirtPkg/PrePi/PrePi.h                                                                                    |   1 -
 ArmVirtPkg/{Library/ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c}                 | 109 +++++----------
 ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf                                                      |  60 +++++++++
 43 files changed, 717 insertions(+), 1501 deletions(-)
 create mode 100644 ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h
 create mode 100644 ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h
 delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
 delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
 delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf
 delete mode 100644 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c
 delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S
 delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm
 delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf
 delete mode 100644 ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c
 delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
 delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
 delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf
 delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c
 delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c
 delete mode 100644 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c
 create mode 100644 ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c
 create mode 100644 ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf
 rename ArmVirtPkg/Library/{ArmVirtPlatformLib/AARCH64/VirtHelper.S => QemuVirtMemInfoLib/AArch64/PhysAddrTop.S} (58%)
 create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S
 rename ArmVirtPkg/Library/{ArmQemuRelocatablePlatformLib/QemuVirtMem.c => QemuVirtMemInfoLib/QemuVirtMemInfoLib.c} (59%)
 create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf
 create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S
 create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S
 create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c
 create mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf
 rename ArmVirtPkg/{Library/ArmQemuRelocatablePlatformLib => PrePi}/FdtParser.c (100%)
 rename ArmVirtPkg/{Library/ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c} (53%)
 create mode 100644 ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf

-- 
2.11.0



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

end of thread, other threads:[~2017-11-22  8:40 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 16:08 [PATCH 00/15] ArmVirtPkg: get rid of ArmPlatformLib Ard Biesheuvel
2017-11-17 16:08 ` [PATCH 01/15] ArmPlatformPkg/ArmPlatformLibNull: remove bogus PCD dependencies Ard Biesheuvel
2017-11-17 16:20   ` Leif Lindholm
2017-11-17 16:23     ` Ard Biesheuvel
2017-11-17 16:28       ` Leif Lindholm
2017-11-17 19:10         ` Ard Biesheuvel
2017-11-17 16:09 ` [PATCH 02/15] ArmVirtPkg/PrePi: run all library constructors by hand Ard Biesheuvel
2017-11-21 15:32   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 03/15] ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function Ard Biesheuvel
2017-11-21 15:36   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 04/15] ArmVirtPkg/PrePi: remove bogus primary core check Ard Biesheuvel
2017-11-21 15:40   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 05/15] ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib Ard Biesheuvel
2017-11-21 15:46   ` Laszlo Ersek
2017-11-21 15:47     ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 06/15] ArmVirtPkg/PrePi: move DRAM discovery code into PrePi Ard Biesheuvel
2017-11-21 15:48   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 07/15] ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency Ard Biesheuvel
2017-11-21 15:51   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 08/15] ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency Ard Biesheuvel
2017-11-21 15:52   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 09/15] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings Ard Biesheuvel
2017-11-21 16:15   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 10/15] ArmVirtPkg: introduce ArmVirtMemInfoLib library class Ard Biesheuvel
2017-11-21 16:23   ` Laszlo Ersek
2017-11-21 16:27     ` Laszlo Ersek
2017-11-21 16:32       ` Ard Biesheuvel
2017-11-17 16:09 ` [PATCH 11/15] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation Ard Biesheuvel
2017-11-21 16:30   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 12/15] ArmVirtPkg/ArmVirtQemu: " Ard Biesheuvel
2017-11-21 16:47   ` Ard Biesheuvel
2017-11-21 16:56   ` Laszlo Ersek
2017-11-21 17:11     ` Ard Biesheuvel
2017-11-17 16:09 ` [PATCH 13/15] ArmVirtPkg: implement ArmVirtMemInfo PPI, PEIM and library Ard Biesheuvel
2017-11-21 17:49   ` Laszlo Ersek
2017-11-21 17:57     ` Ard Biesheuvel
2017-11-21 20:17       ` Laszlo Ersek
2017-11-21 20:32         ` Ard Biesheuvel
2017-11-22  8:45           ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 14/15] ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib Ard Biesheuvel
2017-11-21 17:51   ` Laszlo Ersek
2017-11-17 16:09 ` [PATCH 15/15] ArmVirtPkg: remove ArmPlatformLib implementations Ard Biesheuvel
2017-11-21 17:52   ` Laszlo Ersek

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