diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-01-04 16:51:35 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-01-10 17:37:39 +0000 |
commit | ec54ce1f1ab41b92782b37ae59e752fff0ef9c41 (patch) | |
tree | a492453bac971fc30d9865e3f70cb730bb663de8 /ArmVirtPkg/ArmVirtQemu.dsc | |
parent | 5ee17c5418bd4e0b26686bff14b71b3d83438a30 (diff) | |
download | edk2-ec54ce1f1ab41b92782b37ae59e752fff0ef9c41.tar.gz |
ArmVirtPkg/ArmVirtQemu: Avoid early ID map on ThunderX
The early ID map used by ArmVirtQemu uses ASID scoped non-global
mappings, as this allows us to switch to the permanent ID map seamlessly
without the need for explicit TLB maintenance.
However, this triggers a known erratum on ThunderX, which does not
tolerate non-global mappings that are executable at EL1, as this appears
to result in I-cache corruption. (Linux disables the KPTI based Meltdown
mitigation on ThunderX for the same reason)
So work around this, by detecting the CPU implementor and part number,
and proceeding without the early ID map if a ThunderX CPU is detected.
Note that this requires the C code to be built with strict alignment
again, as we may end up executing it with the MMU and caches off.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: dann frazier <dann.frazier@canonical.com>
Diffstat (limited to 'ArmVirtPkg/ArmVirtQemu.dsc')
-rw-r--r-- | ArmVirtPkg/ArmVirtQemu.dsc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index f77443229e..5dd8b6104c 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -31,6 +31,7 @@ DEFINE SECURE_BOOT_ENABLE = FALSE
DEFINE TPM2_ENABLE = FALSE
DEFINE TPM2_CONFIG_ENABLE = FALSE
+ DEFINE CAVIUM_ERRATUM_27456 = FALSE
#
# Network definition
@@ -117,7 +118,11 @@ UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
[BuildOptions]
+!if $(CAVIUM_ERRATUM_27456) == TRUE
+ GCC:*_*_AARCH64_PP_FLAGS = -DCAVIUM_ERRATUM_27456
+!else
GCC:*_*_AARCH64_CC_XIPFLAGS ==
+!endif
!include NetworkPkg/NetworkBuildOptions.dsc.inc
|