public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org, lersek@redhat.com
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v2 00/14] ArmVirtPkg: get rid of ArmPlatformLib
Date: Wed, 22 Nov 2017 10:07:17 +0000	[thread overview]
Message-ID: <20171122100731.24525-1-ard.biesheuvel@linaro.org> (raw)

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.

v2: drop ArmPlatformPkg prereq patch, it is merged now
    use constructor instead of PEIM depex ordering to ensure ArmVirtQemu's
    PcdSystemMemorySize PCD is set before being consumed
    add acks from Laszlo

Ard Biesheuvel (14):
  ArmVirtPkg/PrePi: run all library constructors by hand
  ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function
  ArmVirtPkg/PrePi: remove bogus primary core check
  ArmVirtPkg/PrePi: move DRAM discovery code into PrePi
  ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib
  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: create QemuVirtMemInfoLib version for ArmVirtQemu
  ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib
  ArmVirtPkg: remove ArmPlatformLib implementations

 ArmVirtPkg/ArmVirt.dsc.inc                                                                                  |   1 -
 ArmVirtPkg/ArmVirtPkg.dec                                                                                   |   3 +
 ArmVirtPkg/ArmVirtQemu.dsc                                                                                  |   5 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc                                                                            |   2 +-
 ArmVirtPkg/ArmVirtXen.dsc                                                                                   |   2 +-
 ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h                                                              |  41 ++++++
 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/{ArmVirtPlatformLib/AARCH64/VirtHelper.S => QemuVirtMemInfoLib/AArch64/PhysAddrTop.S}    |  33 +----
 ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S                                                     |  24 ++++
 ArmVirtPkg/Library/{ArmQemuRelocatablePlatformLib/QemuVirtMem.c => QemuVirtMemInfoLib/QemuVirtMemInfoLib.c} |  62 ++++-----
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf                                                |  54 ++++++++
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf                                             |  58 ++++++++
 ArmVirtPkg/Library/{ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c}     |  92 +++----------
 ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S                                                  |  39 ++++++
 ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S                                                      |  24 ++++
 ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c                                                    |  63 +++++++++
 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                                                                                    |   7 -
 38 files changed, 562 insertions(+), 1504 deletions(-)
 create mode 100644 ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.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
 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} (58%)
 create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf
 create mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf
 rename ArmVirtPkg/Library/{ArmVirtPlatformLib/Virt.c => QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c} (52%)
 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%)

-- 
2.11.0



             reply	other threads:[~2017-11-22 10:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 10:07 Ard Biesheuvel [this message]
2017-11-22 10:07 ` [PATCH v2 01/14] ArmVirtPkg/PrePi: run all library constructors by hand Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 02/14] ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 03/14] ArmVirtPkg/PrePi: remove bogus primary core check Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 04/14] ArmVirtPkg/PrePi: move DRAM discovery code into PrePi Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 05/14] ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 06/14] ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 07/14] ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 08/14] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings Ard Biesheuvel
2017-11-22 10:07 ` [PATCH v2 09/14] ArmVirtPkg: introduce ArmVirtMemInfoLib library class Ard Biesheuvel
2017-11-23 16:00   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 10/14] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation Ard Biesheuvel
2017-11-22 17:03   ` Julien Grall
2017-11-22 10:07 ` [PATCH v2 11/14] ArmVirtPkg/ArmVirtQemu: " Ard Biesheuvel
2017-11-23 16:18   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 12/14] ArmVirtPkg: create QemuVirtMemInfoLib version for ArmVirtQemu Ard Biesheuvel
2017-11-23 16:26   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 13/14] ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib Ard Biesheuvel
2017-11-23 16:32   ` Laszlo Ersek
2017-11-22 10:07 ` [PATCH v2 14/14] ArmVirtPkg: remove ArmPlatformLib implementations Ard Biesheuvel
2017-11-23 16:56 ` [PATCH v2 00/14] ArmVirtPkg: get rid of ArmPlatformLib Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171122100731.24525-1-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox