u-boot/arch/arm/cpu
Ilias Apalodimas a5ac47911a arm64: Fix page permissions for platforms running at EL2
We currently set both and print both PXN and UXN bits when removing
execution for pages. This happens even in the existing per platform
definitions of 'struct mm_region'.

That's not entirely correct though. For stage-1 translations, if a
platform runs on a translation regime with a single privilege level or the
the translation regime supports two privilege levels and we are not
in EL1&0 with HCR_EL2.{NV, NV1} = {1, 1} only BIT54 (XN) is needed
and BIT53(PXN) is reserved 0.

Currently we support Non-Secure EL2, Non-secure EL2&0 and Non-secure
EL1&0.

We already have get_effective_el() which returns 1 if we are
- Running in EL1 so we assume an EL1 translation regime but without
  checking HCR_EL2.{NV, NV1} != {1,1}
- Running in EL2 with HCR_EL2.E2H = 1

The only problem with the above is that if we are in EL1&0 and
HCR_EL2.{NV1, NV} == {1, 1}, then
- Bit[54] holds the PXN instead of the UXN
- The Effective value of UXN is 0
- Bit[53] is RES0

So let's re-use that function and set PXN only when we are in
and EL[2|1]&0 translation regime.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-04 12:24:56 -06:00
..
arm11 arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD 2024-10-11 11:44:47 -06:00
arm720t Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
arm920t global: Rename SPL_ to XPL_ 2024-10-11 11:44:48 -06:00
arm926ejs treewide: Add a function to change page permissions 2025-03-14 13:37:54 +02:00
arm946es Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
arm1136 arm: move _end to linker symbols 2024-06-07 16:20:29 -06:00
arm1176 arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD 2024-10-11 11:44:47 -06:00
armv7 treewide: Add a function to change page permissions 2025-03-14 13:37:54 +02:00
armv7m treewide: Add a function to change page permissions 2025-03-14 13:37:54 +02:00
armv8 arm64: Fix page permissions for platforms running at EL2 2025-04-04 12:24:56 -06:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u-boot-spl.lds arm: move _end to linker symbols 2024-06-07 16:20:29 -06:00
u-boot.lds arm: Discard unwanted sections in linker script 2025-04-02 14:33:50 -06:00