public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 00/13] ArmPkg, ArmVirtPkg: lift 40-bit IPA space limit
@ 2018-11-26 22:37 Ard Biesheuvel
  2018-11-26 22:37 ` [PATCH v2 01/13] ArmPkg/ArmLib: add support for reading the max physical address space size Ard Biesheuvel
                   ` (13 more replies)
  0 siblings, 14 replies; 22+ messages in thread
From: Ard Biesheuvel @ 2018-11-26 22:37 UTC (permalink / raw)
  To: edk2-devel
  Cc: Ard Biesheuvel, Laszlo Ersek, Leif Lindholm, Eric Auger,
	Andrew Jones, Philippe Mathieu-Daude, Julien Grall

The ArmVirtQemu targets currently limit the size of the IPA space to
40 bits because that is all what KVM supports. However, this is about
to change, and so we need to update the code if we want to ensure that
our UEFI firmware builds can keep running on systems that set values
other than 40 (which could be > 40 or < 40)

So refactor the way we deal with this limit, both for bare metal and for
virtual targets, so that
a) the range of the GCD memory map is based directly on the CPU's PA range
b) the range of the 1:1 mapping in the page tables is based on the CPU's PA
   range (unless it exceeds what the architecture permits for 4k pages)
c) PcdPrePiCpuMemorySize is no longer needed, and can be removed.

Patch #1 introduces ARM_MMU_IDMAP_RANGE and ArmGetPhysicalAddressBits ()
in ArmLib.

Patch #2 updates the virt targets to replace a local definition of
ArmGetPhysicalAddressBits () with the new ArmLib implementation.

Patch #3 updates the ARM MMU code so that the maximum size of the
virtual address space is based on ArmGetPhysicalAddressBits () or
ARM_MMU_IDMAP_RANGE (whichever produces the smallest result), and
no longer on PcdPrePiCpuMemorySize

Patch #4 - #8 update all invocations of BuildCpuHob() so that the size
of the GCD memory map is based on the CPU's capabilities (and no longer
on PcdPrePiCpuMemorySize)

Patch #9 and #10 drop some unused PCD references from .inf files.

Patch #11 updates QemuVirtMemInfoLib to no longer take PcdPrePiCpuMemorySize
into account.

Patch #12 removes all overrides of PcdPrePiCpuMemorySize

Patch #13 (which should only be merged after edk2-platforms has been updated
as well) removes PcdPrePiCpuMemorySize entirely.

Changes since v1:
- add a define ARM_MMU_IDMAP_RANGE that describes the maximum size of
  the virtual address space when running with 4k pages, which may
  deviate from the maximum size when running under the OS
- to avoid having to reason in complicated ways between ARM_MMU_IDMAP_RANGE,
  the number of physical address bits supported by the CPU and the size
  of the GCD memory map, just drop PcdPrePiCpuMemorySize entirely

Note that I dropped a couple of acks (from Laszlo and Philippe) due to the
fact that the code looks rather different now.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
Cc: Julien Grall <julien.grall@linaro.org>

Ard Biesheuvel (13):
  ArmPkg/ArmLib: add support for reading the max physical address space
    size
  ArmVirtPkg: refactor reading of the physical address space size
  ArmPkg/ArmMmuLib: take the CPU supported maximum PA space into account
  ArmPkg/CpuPei: base GCD memory space size on CPU's PA range
  ArmPlatformPkg/PrePi: base GCD memory space size on CPU's PA range
  ArmVirtPkg/PrePi: base GCD memory space size on CPU's PA range
  BeagleBoardPkg/PrePi: base GCD memory space size on CPU's PA range
  EmbeddedPkg/PrePiHobLib: base GCD memory space size on CPU's PA range
  ArmPlatformPkg/PlatformPei: drop unused PCD references
  EmbeddedPkg/PrePiLib: drop unused PCD reference
  ArmVirtPkg/QemuVirtMemInfoLib: ignore PcdPrePiCpuMemorySize
  ArmVirtPkg: drop PcdPrePiCpuMemorySize assignments from all platforms
  EmbeddedPkg/EmbeddedPkg.dec: drop PcdPrePiCpuMemorySize declarations

 EmbeddedPkg/EmbeddedPkg.dec                   |  4 --
 ArmVirtPkg/ArmVirt.dsc.inc                    |  3 --
 ArmVirtPkg/ArmVirtQemu.dsc                    |  4 --
 ArmVirtPkg/ArmVirtQemuKernel.dsc              |  4 --
 ArmPkg/Drivers/CpuPei/CpuPei.inf              |  1 -
 ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf    |  3 --
 ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf     |  3 --
 ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf |  3 --
 ArmPlatformPkg/PlatformPei/PlatformPeim.inf   |  3 --
 ArmPlatformPkg/PrePi/PeiMPCore.inf            |  1 -
 ArmPlatformPkg/PrePi/PeiUniCore.inf           |  1 -
 .../QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf |  7 ----
 .../QemuVirtMemInfoPeiLib.inf                 |  7 ----
 .../XenVirtMemInfoLib/XenVirtMemInfoLib.inf   |  6 ---
 .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf  |  1 -
 BeagleBoardPkg/PrePi/PeiUniCore.inf           |  1 -
 .../Library/PrePiHobLib/PrePiHobLib.inf       |  1 -
 EmbeddedPkg/Library/PrePiLib/PrePiLib.inf     |  1 -
 ArmPkg/Include/Library/ArmLib.h               | 17 ++++++++
 .../Include/Library/ArmVirtMemInfoLib.h       |  1 +
 ArmPkg/Drivers/CpuPei/CpuPei.c                |  2 +-
 .../Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 11 +++++-
 ArmPlatformPkg/PrePi/PrePi.c                  |  2 +-
 .../ArmVirtMemoryInitPeiLib.c                 |  5 ++-
 .../QemuVirtMemInfoLib/QemuVirtMemInfoLib.c   | 11 +-----
 .../XenVirtMemInfoLib/XenVirtMemInfoLib.c     |  8 +---
 ArmVirtPkg/PrePi/PrePi.c                      |  2 +-
 BeagleBoardPkg/PrePi/PrePi.c                  |  2 +-
 EmbeddedPkg/Library/PrePiHobLib/Hob.c         |  2 +-
 ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S | 16 ++++++++
 ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S     |  8 ++++
 .../QemuVirtMemInfoLib/AArch64/PhysAddrTop.S  | 39 -------------------
 .../QemuVirtMemInfoLib/Arm/PhysAddrTop.S      | 24 ------------
 .../XenVirtMemInfoLib/AArch64/PhysAddrTop.S   | 39 -------------------
 .../XenVirtMemInfoLib/Arm/PhysAddrTop.S       | 24 ------------
 35 files changed, 64 insertions(+), 203 deletions(-)
 delete mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/AArch64/PhysAddrTop.S
 delete mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S
 delete mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S
 delete mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S

-- 
2.19.1



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

end of thread, other threads:[~2018-11-27 14:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-26 22:37 [PATCH v2 00/13] ArmPkg, ArmVirtPkg: lift 40-bit IPA space limit Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 01/13] ArmPkg/ArmLib: add support for reading the max physical address space size Ard Biesheuvel
2018-11-26 22:43   ` Philippe Mathieu-Daudé
2018-11-26 23:02     ` Philippe Mathieu-Daudé
2018-11-26 23:03       ` Ard Biesheuvel
2018-11-27 12:26   ` Ard Biesheuvel
2018-11-27 14:51   ` Auger Eric
2018-11-26 22:37 ` [PATCH v2 02/13] ArmVirtPkg: refactor reading of the " Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 03/13] ArmPkg/ArmMmuLib: take the CPU supported maximum PA space into account Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 04/13] ArmPkg/CpuPei: base GCD memory space size on CPU's PA range Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 05/13] ArmPlatformPkg/PrePi: " Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 06/13] ArmVirtPkg/PrePi: " Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 07/13] BeagleBoardPkg/PrePi: " Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 08/13] EmbeddedPkg/PrePiHobLib: " Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 09/13] ArmPlatformPkg/PlatformPei: drop unused PCD references Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 10/13] EmbeddedPkg/PrePiLib: drop unused PCD reference Ard Biesheuvel
2018-11-26 22:37 ` [PATCH v2 11/13] ArmVirtPkg/QemuVirtMemInfoLib: ignore PcdPrePiCpuMemorySize Ard Biesheuvel
2018-11-26 22:38 ` [PATCH v2 12/13] ArmVirtPkg: drop PcdPrePiCpuMemorySize assignments from all platforms Ard Biesheuvel
2018-11-26 22:38 ` [PATCH v2 13/13] EmbeddedPkg/EmbeddedPkg.dec: drop PcdPrePiCpuMemorySize declarations Ard Biesheuvel
2018-11-27 12:11 ` [PATCH v2 00/13] ArmPkg, ArmVirtPkg: lift 40-bit IPA space limit Laszlo Ersek
2018-11-27 12:13   ` Ard Biesheuvel
2018-11-27 14:35     ` Laszlo Ersek

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