| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code resulting from building the barebox ARM64 assembly contains
relocations, which could've been position-independent just as well.
Let's make them truly position independent by turning:
ldr x0, =label
into
adr_l x0, label
adr_l is position independent by virtue of being implemented using adrp,
so it's usuable as-is before relocation and requires no manual addition
of get_runtime_offset().
With these changes, only relocation necessary for the ARM64 generic DT
2nd stage is the one needed for get_runtime_offset() to find out
whether barebox has been relocated.
This is one step towards supporting mapping barebox PBL text section
W^X, which precludes relocation entries emitted for code.
With this change applied, there is still a data relocation entry
in assembly code for get_runtime_offset(), but that doesn't bother us
because it's in the data section.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-57-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Plain memset and memcpy are checked by KASAN if enabled before calling
unchecked __memset and __memcpy respectively.
KASAN uses a kasan_initialized variable as first condition in its memory
check, but that only works after relocation. For that reason, we must
take care not to invoke KASAN before then. This was done for ARM32, but
was missing for ARM64. Do so now.
This fixes an annoying issue where network booting a KASAN-enabled barebox
twice in a row would fail: The first happened to work because the memory
kasan_initialized was placed at was zero. The second would behave
erratically, because BSS initialization would silently fail and barebox
static storage would then be initialized with the final values of the
previous run.
Fixes: 932ef7a02e2f ("ARM: Add KASan support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230415083447.3069903-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__piggydata_end and __image_end used to be synonyms before the addition
of external firmware. Now that external firmware is located after
__piggydata_end, code using it needs to be revisited.
There's no reason to have code reference __piggydata_end. Either they
want all the rest of the image, so they should use __image_end instead
or they want just the piggy data, in which case they can read the data
size embedded into the piggydata itself.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220818050447.2072932-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Record GPL-2.0-only as license for all files lacking an explicit license
statement.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220103120539.1730644-10-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
relocate_to_adr() currently relocates the PBL code to another address,
but doesn't move the piggy data (compressed barebox image). This patch
adds relocate_to_adr_full() which moves the full image including the
piggy data. This is needed for upcoming Rockchip RK3568 support. Here
we are started at address 0x0, but must move away from that address as
this is where the ATF/OP-Tee binaries are expected to be loaded.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210615141641.31577-6-s.hauer@pengutronix.de
Link: https://lore.barebox.org/20210621092802.27275-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have several places in the code which which prepares just modified code
for execution. This is done differently in all the places, so add a common
function to be used by all.
Most places called arm_early_mmu_cache_flush(). This function includes
invalidating the instruction cache, so doing it again is unnecessary.
Sometimes we had arm_early_mmu_cache_flush() inside #ifdef CONFIG_MMU.
The ifdef seems unnecessary since we do not have it consistently, so
remove the ifdef.
Some early i.MX xload code had icache_invalidate() but forgot to flush
the caches. Replace the instruction cache invalidation with
sync_caches_for_execution().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
This adds aarch64 support for relocating binaries linked with -pie.
Support is integrated into the already exisiting
relocate_to_current_adr() function which is now used for both arm32
and aarch64.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
This patch adds arm64 specific codes, which are:
- exception support
- cache support
- rework Makefile to support arm64
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|