[PATCH] arm64: Force position-independent veneers
Ard Biesheuvel
ardb at kernel.org
Fri Sep 27 03:42:37 PDT 2024
On Fri, 27 Sept 2024 at 12:18, Mark Rutland <mark.rutland at arm.com> wrote:
>
> Certain portions of code always need to be position-independent
> regardless of CONFIG_RELOCATABLE, including code which is executed in an
> idmap or which is executed before relocations are applied. In some
> kernel configurations the LLD linker generates position-dependent
> veneers for such code, and when executed these result in early boot-time
> failures.
>
...
>
> I've opted to pass '--pic-veneer' unconditionally, as:
>
> * In addition to solving the boot failure, these sequences are generally
> nicer as they require fewer instructions and don't need to perform
> data accesses.
>
Yeah, and accessing literal pools interspersed with the code. I find
it rather bizarre that --pic-veneer is not the default when using the
small code model.
...
>
> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> Reported-by: Marc Zyngier <maz at kernel.org>
> Cc: Ard Biesheuvel <ardb at kernel.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Nathan Chancellor <nathan at kernel.org>
> Cc: Nick Desaulniers <ndesaulniers at google.com>
> Cc: Will Deacon <will at kernel.org>
> ---
> arch/arm64/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Ard Biesheuvel <ardb at kernel.org>
More information about the linux-arm-kernel
mailing list