android_kernel_xiaomi_sm8450/arch/arm64
Sami Tolvanen a45ee4c98d KVM: arm64: Don't use cbz/adr with external symbols
commit dbaee836d60a8e1b03e7d53a37893235662ba124 upstream.

allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following
linker errors:

  ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC):
  relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in
  [-1048576, 1048575]; references hyp_panic
  >>> defined in vmlinux.o

  ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0):
  relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in
  [-1048576, 1048575]; references hyp_panic
  >>> defined in vmlinux.o

This is because with LTO, the compiler ends up placing hyp_panic()
more than 1MB away from __guest_enter(). Use an unconditional branch
and adr_l instead to fix the issue.

Link: https://github.com/ClangBuiltLinux/linux/issues/1317
Reported-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Marc Zyngier <maz@kernel.org>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Will Deacon <will@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210305202124.3768527-1-samitolvanen@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-09-04 13:17:44 +02:00
..
boot arm64: dts: amlogic: gx: correct hdmi clocks 2024-08-19 05:40:43 +02:00
configs arm64: defconfig: build imx-sdma as a module 2022-04-08 14:40:34 +02:00
crypto crypto: arm64/gcm - Select AEAD for GHASH_ARM64_CE 2022-08-21 15:15:44 +02:00
include arm64: cputype: Add Cortex-A725 definitions 2024-08-19 05:41:16 +02:00
kernel arm64: ACPI: NUMA: initialize all values of acpi_early_node_map to NUMA_NO_NODE 2024-09-04 13:17:29 +02:00
kvm KVM: arm64: Don't use cbz/adr with external symbols 2024-09-04 13:17:44 +02:00
lib arm64: csum: Fix OoB access in IP checksum code for negative lengths 2023-09-19 12:20:21 +02:00
mm arm64: mm: fix VA-range sanity check 2023-07-27 08:44:37 +02:00
net bpf, arm64: Clear prog->jited_len along prog->jited 2022-06-14 18:32:40 +02:00
xen arm64: xen: Use modern annotations for assembly functions 2020-01-09 16:09:42 +00:00
Kbuild arm64: add arch/arm64/Kbuild 2019-08-21 18:47:15 +01:00
Kconfig arm64: errata: Expand speculative SSBS workaround (again) 2024-08-19 05:41:16 +02:00
Kconfig.debug arm64: remove TEXT_OFFSET randomization 2020-06-15 13:10:59 +01:00
Kconfig.platforms irqchip/exiu: Fix acknowledgment of edge triggered interrupts 2022-06-09 10:21:05 +02:00
Makefile arm64: link with -z norelro for LLD or aarch64-elf 2021-01-12 20:18:24 +01:00