audk/ArmPkg
Ard Biesheuvel 017564d637 ArmPkg/ArmMmuLib AARCH64: avoid EL0 accessible mappings
We never run any code at EL0, and so it would seem that any access
permissions set for EL0 (via the AP[1] attribute in the page tables) are
irrelevant. We currently set EL0 and EL1 permissions to the same value
arbitrarily.

However, this causes problems on hardware like the Apple M1 running the
MacOS hypervisor framework, which enters EL1 with SCTLR_EL1.SPAN
enabled, causing the Privileged Access Never (PAN) feature to be enabled
on any exception taken to EL1, including the IRQ exceptions that handle
our timer interrupt. When PAN is enabled, EL1 has no access to any
mappings that are also accessible to EL0, causing the firmware to crash
if it attempts to access such a mapping.

Even though it is debatable whether or not SCTLR_EL1.SPAN should be
disabled at entry or whether the firmware should put all UNKNOWN bits in
all system registers in a consistent state (which it should), using EL0
permissions serves no purpose whatsoever so let's fix that regardless.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Alexander Graf <agraf@csgraf.de>
Acked-by: Leif Lindholm <leif@nuviainc.com>
2022-02-01 23:09:01 +00:00
..
Drivers ArmPkg/ArmMmuLib AARCH64: avoid EL0 accessible mappings 2022-02-01 23:09:01 +00:00
Filesystem/SemihostFs ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Include ArmPkg: Replace CoreId and ClusterId with Mpidr in ARM_CORE_INFO struct 2022-01-30 11:04:41 +00:00
Library ArmPkg/ArmMmuLib AARCH64: avoid EL0 accessible mappings 2022-02-01 23:09:01 +00:00
Universal/Smbios ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib 2021-12-16 18:08:22 +00:00
ArmPkg.ci.yaml ArmPkg: Update YAML to ignore specific ECC files/errors 2021-11-30 14:19:07 +00:00
ArmPkg.dec ArmPkg: Implement PlatformBootManagerLib for LinuxBoot 2021-10-23 08:38:20 +00:00
ArmPkg.dsc ArmPkg: Implement PlatformBootManagerLib for LinuxBoot 2021-10-23 08:38:20 +00:00