summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-01-29 15:58:26 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-02-25 15:57:11 +0000
commit2dbed5250648794bdb6cb0d9111af9924a4e4e00 (patch)
tree8ba7123e14bc4c5249fedb6ac0d59320a08727c1 /ArmVirtPkg/Library
parentb24306f15daa2ff8510b06702114724b33895d3c (diff)
downloadedk2-2dbed5250648794bdb6cb0d9111af9924a4e4e00.tar.gz
edk2-2dbed5250648794bdb6cb0d9111af9924a4e4e00.tar.bz2
edk2-2dbed5250648794bdb6cb0d9111af9924a4e4e00.zip
ArmVirtPkg/ArmVirtMemoryInitPeiLib: avoid redundant cache invalidation
Alex reports that the cache invalidation performed by ArmVirtMemoryInitPeiLib takes a non-negligible amount of time at boot. This cache invalidation used to be necessary to avoid inconsistencies between the CPU's cached and uncached views of the permanent PEI memory region, given that the PEI phase is where the MMU gets enabled. The only allocations done from permanent PEI memory with the MMU off are pages used for page tables, and since commit 748fea6279ef ("ArmPkg/ArmMmuLib AARCH64: invalidate page tables before populating them"), each of those is invalidated in the caches explicitly, for reasons described in the patch's commit log. All other allocations done in PEI are either from temporary PEI memory, which includes the stack, or from permanent PEI memory but after the MMU has been enabled. This means that the cache invalidation in ArmVirtMemoryInitPeiLib is no longer necessary, and can simply be dropped. Reported-by: Alexander Graf <graf@amazon.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Alexander Graf <graf@amazon.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmVirtPkg/Library')
-rw-r--r--ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c
index 022e13e762..98d90ad420 100644
--- a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c
+++ b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c
@@ -91,15 +91,6 @@ MemoryPeim (
);
}
- //
- // When running under virtualization, the PI/UEFI memory region may be
- // clean but not invalidated in system caches or in lower level caches
- // on other CPUs. So invalidate the region by virtual address, to ensure
- // that the contents we put there with the caches and MMU off will still
- // be visible after turning them on.
- //
- InvalidateDataCacheRange ((VOID *)(UINTN)UefiMemoryBase, UefiMemorySize);
-
// Build Memory Allocation Hob
InitMmu ();