audk/ArmPkg/Library
Mark Rutland fafb7e9c11 ArmPkg: correct TTBR1_EL1 settings in TCR_EL1
As EDK2 runs in an idmap, we do not use TTBR1_EL1, nor do we configure
it. TTBR1_EL1 may contain UNKNOWN values if it is not programmed since
reset.

Prior to enabling the MMU, we do not set TCR_EL1.EPD1, and hence the CPU
may make page table walks via TTBR1_EL1 at any time, potentially using
UNKNOWN values. This can result in a number of potential problems (e.g.
the CPU may load from MMIO registers as part of a page table walk).

Additionally, in the presence of Cortex-A57 erratum #822227, we must
program TCR_EL1.TG1 == 0b1x (e.g. 4KB granule) regardless of the value
of TCR_EL1.EPD1, to ensure that EDK2 can make forward progress under a
hypervisor which makes use of PAR_EL1.

This patch ensures that we program TCR_EL1.EPD1 and TCR_EL1.TG1 as above
to avoid these issues. TCR_EL1.TG1 is set to 4K for all targets, as any
CPU capable of running EDK2 must support this granule, and given
TCR_EL1.EPD1, programming the field is not detrimental in the absence of
the erratum.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18903 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-19 14:14:25 +00:00
..
ArmArchTimerLib ArmPkg: ArmArchTimerLib: conditionally rebase to actual timer frequency 2015-02-02 12:01:48 +00:00
ArmCacheMaintenanceLib ArmCacheMaintenanceLib: disallow whole D-cache maintenance operations 2015-11-09 13:27:36 +00:00
ArmDisassemblerLib ArmPkg/ArmDisassemblerLib: ARMThumb and AArch64 fixes 2014-09-09 15:57:18 +00:00
ArmDmaLib ArmPkg/ArmDmaLib: use the cache writeback granularity for alignment 2015-11-09 13:28:33 +00:00
ArmGenericTimerPhyCounterLib ArmPkg: add ArmGenericTimerCounterLib implementation using physical timer 2014-09-09 16:06:10 +00:00
ArmGenericTimerVirtCounterLib ArmPkg: add ArmGenericTimerCounterLib implementation using virtual timer 2014-09-09 16:07:43 +00:00
ArmGicArchLib ArmPkg: cache detected revision in ArmGicArchLib 2015-07-28 20:45:10 +00:00
ArmGicArchSecLib ArmPkg: copy ArmGicArchLib to ArmGicArchSecLib 2015-07-28 20:44:58 +00:00
ArmHvcLib ArmPkg: Ensured the stack is always quad-word aligned 2014-11-11 00:51:11 +00:00
ArmLib ArmPkg: correct TTBR1_EL1 settings in TCR_EL1 2015-11-19 14:14:25 +00:00
ArmPsciResetSystemLib Renamed ArmPlatformPkg/ArmVirtualizationPkg into ArmVirtPkg 2015-05-29 13:50:43 +00:00
ArmSmcLib ArmPkg: Ensured the stack is always quad-word aligned 2014-11-11 00:51:11 +00:00
ArmSmcLibNull ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
BaseMemoryLibStm ArmPkg/BaseMemoryLib(Sym|Vstm): Do not post increment returned pointer 2015-04-02 13:51:28 +00:00
BaseMemoryLibVstm ArmPkg/BaseMemoryLib(Sym|Vstm): Do not post increment returned pointer 2015-04-02 13:51:28 +00:00
BdsLib ArmPkg/BdsLib: Increase fallback tftp buffer size 2015-11-09 13:13:37 +00:00
CompilerIntrinsicsLib ArmPkg/CompilerIntrinsicesLib: Fixed memmove() and memset() 2014-11-11 00:52:11 +00:00
DebugAgentSymbolsBaseLib ArmPkg: ensure DebugAgentVectorTable is 2K-aligned 2015-11-17 13:58:19 +00:00
DebugPeCoffExtraActionLib ArmPkg: DebugPeCoffExtraActionLib: debugger commands are not errors 2015-03-02 16:19:26 +00:00
DebugUncachedMemoryAllocationLib ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
DefaultExceptionHandlerLib ARM Packages: Replace tabs by spaces for indentation 2014-08-26 10:14:17 +00:00
PeiServicesTablePointerLib ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
RvdPeCoffExtraActionLib ArmPkg/Semihostlib: Rename semi-hosting open option 2014-10-27 10:37:20 +00:00
SemiHostingDebugLib ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
SemiHostingSerialPortLib ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
SemihostLib ArmPkg/SemihostLib: Add library functions 2014-10-27 10:38:18 +00:00
UncachedMemoryAllocationLib ArmPkg: Bug fix for UncachedMemoryAllocationLib 2015-09-02 16:29:31 +00:00