]> git.baikalelectronics.ru Git - kernel.git/commit
efi/arm: Deal with ADR going out of range in efi_enter_kernel()
authorArd Biesheuvel <ardb@kernel.org>
Thu, 9 Apr 2020 13:04:30 +0000 (15:04 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 14 Apr 2020 06:32:14 +0000 (08:32 +0200)
commit213dceee8879c1d1ca1a607723a89726a404b4ac
tree349cc33f1ac553ff4ecbd49fce8f719c6ee91c2a
parent8265717e6f7be418adc1b9c7ec3adc1a20a15a71
efi/arm: Deal with ADR going out of range in efi_enter_kernel()

Commit

  70c3c978a6a3 ("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 <arnd@arndb.de>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200409130434.6736-6-ardb@kernel.org
arch/arm/boot/compressed/head.S