Skip to content

Commit a946916

Browse files
ardbiesheuvelIngo Molnar
authored andcommitted
efi/arm: Deal with ADR going out of range in efi_enter_kernel()
Commit 0698fac ("efi/arm: Clean EFI stub exit code from cache instead of avoiding it") introduced a PC-relative reference to 'call_cache_fn' into efi_enter_kernel(), which lives way at the end of head.S. In some cases, the ARM version of the ADR instruction does not have sufficient range, resulting in a build error: arch/arm/boot/compressed/head.S:1453: Error: invalid constant (fffffffffffffbe4) after fixup ARM defines an alternative with a wider range, called ADRL, but this does not exist for Thumb-2. At the same time, the ADR instruction in Thumb-2 has a wider range, and so it does not suffer from the same issue. So let's switch to ADRL for ARM builds, and keep the ADR for Thumb-2 builds. Reported-by: Arnd Bergmann <[email protected]> Tested-by: Arnd Bergmann <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 21cb9b4 commit a946916

File tree

1 file changed

+2
-1
lines changed
  • arch/arm/boot/compressed

1 file changed

+2
-1
lines changed

arch/arm/boot/compressed/head.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,8 @@ ENTRY(efi_enter_kernel)
14501450
@ running beyond the PoU, and so calling cache_off below from
14511451
@ inside the PE/COFF loader allocated region is unsafe unless
14521452
@ we explicitly clean it to the PoC.
1453-
adr r0, call_cache_fn @ region of code we will
1453+
ARM( adrl r0, call_cache_fn )
1454+
THUMB( adr r0, call_cache_fn ) @ region of code we will
14541455
adr r1, 0f @ run with MMU off
14551456
bl cache_clean_flush
14561457
bl cache_off

0 commit comments

Comments
 (0)