u-boot/include/asm-generic
Ilias Apalodimas 1c7d0c411c arm: Prepare linker scripts for memory permissions
Upcoming patches are switching the memory mappings to RW, RO, RX
after the U-Boot binary and its data are relocated. Add
annotations in the linker scripts to and mark text, data, rodata
sections and align them to a page boundary.

It's worth noting that .efi_runtime memory permissions are left
untouched for now. There's two problems with EFI currently.

The first problem is that we bundle data, rodata and text in a single
.efi_runtime section which also must be close to .text for now.
As a result we also dont change the permissions for anything contained
in CPUDIR/start.o. In order to fix that we have to decoule .text_rest,
.text and .efi_runtime and have the runtime services on their own
section with proper memory permission annotations (efi_rodata etc).

The efi runtime regions (.efi_runtime_rel) can be relocated by the OS when
the latter is calling SetVirtualAddressMap. Which means we have to
configure those pages as RX for U-Boot but convert them to RWX just before
ExitBootServices. It also needs extra code in efi_tuntime relocation
code since R_AARCH64_NONE are emitted as well if we page align the
section.

Due to the above ignore EFI for now and fix it later once we have the
rest in place.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905X-CC
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:30:12 +02:00
..
bitops arm: Use builtins for ffs/fls 2023-08-17 16:39:20 -04:00
atomic-long.h atomic-long: Fix warnings on arm64 2018-01-28 09:39:05 -05:00
atomic.h Add include/asm-generic/atomic.h 2018-09-25 21:49:18 -04:00
bitsperlong.h linux/bitops.h: GENMASK copy from linux 2015-10-21 09:14:07 -04:00
global_data.h Revert "global_data: Drop spl_handoff" 2024-12-02 07:40:39 -06:00
gpio.h gpio: Use separate bitfield array to indicate GPIO is claimed 2023-08-14 17:55:53 -04:00
int-ll64.h include: asm-generic: Remove duplicate newlines 2024-07-29 15:01:04 -06:00
io.h asm-generic: Import functions from Linux 2023-11-28 16:19:06 -05:00
ioctl.h x86: Fix support for booting bzImage 2010-05-06 00:17:01 +02:00
pe.h efi_loader: set IMAGE_DLLCHARACTERISTICS_NX_COMPAT 2024-02-28 14:37:46 +01:00
sections.h arm: Prepare linker scripts for memory permissions 2025-03-14 13:30:12 +02:00
signal.h asm-generic/signal.h: import from linux 2010-01-17 20:36:05 -05:00
u-boot.h global: Remove bi_sramstart/bi_sramsize 2024-11-16 19:49:13 -06:00
unaligned.h asm-generic: simplify unaligned.h 2023-05-31 14:05:34 -04:00