linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] ARM: vfp: Use long jump to fix THUMB2 kernel compilation error
@ 2020-10-21 22:57 Dmitry Osipenko
  2020-10-21 23:40 ` Kees Cook
  2020-10-22 14:57 ` Russell King - ARM Linux admin
  0 siblings, 2 replies; 28+ messages in thread
From: Dmitry Osipenko @ 2020-10-21 22:57 UTC (permalink / raw)
  To: Russell King, Kees Cook, Nick Desaulniers, Ingo Molnar
  Cc: linux-arm-kernel, linux-kernel

The vfp_kmode_exception() function now is unreachable using relative
branching in THUMB2 kernel configuration, resulting in a "relocation
truncated to fit: R_ARM_THM_JUMP19 against symbol `vfp_kmode_exception'"
linker error. Let's use long jump in order to fix the issue.

Fixes: eff8728fe698 ("vmlinux.lds.h: Add PGO and AutoFDO input sections")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/vfp/vfphw.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 4fcff9f59947..6e2b29f0c48d 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -82,7 +82,8 @@ ENTRY(vfp_support_entry)
 	ldr	r3, [sp, #S_PSR]	@ Neither lazy restore nor FP exceptions
 	and	r3, r3, #MODE_MASK	@ are supported in kernel mode
 	teq	r3, #USR_MODE
-	bne	vfp_kmode_exception	@ Returns through lr
+	ldr	r1, =vfp_kmode_exception
+	bxne	r1			@ Returns through lr
 
 	VFPFMRX	r1, FPEXC		@ Is the VFP enabled?
 	DBGSTR1	"fpexc %08x", r1
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-11-10  7:45 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 22:57 [PATCH v1] ARM: vfp: Use long jump to fix THUMB2 kernel compilation error Dmitry Osipenko
2020-10-21 23:40 ` Kees Cook
2020-10-22  0:00   ` Dmitry Osipenko
2020-10-22  3:28     ` Kees Cook
2020-10-22  7:06       ` Ard Biesheuvel
2020-10-22 15:57         ` Dmitry Osipenko
2020-10-22 16:06           ` Ard Biesheuvel
2020-10-22 16:11             ` Russell King - ARM Linux admin
2020-10-22 16:20               ` Ard Biesheuvel
2020-10-22 16:23                 ` Russell King - ARM Linux admin
2020-10-22 16:33                   ` Ard Biesheuvel
2020-10-22 17:48                     ` Russell King - ARM Linux admin
2020-10-22 17:59                       ` Ard Biesheuvel
2020-10-26  8:58                         ` Ard Biesheuvel
2020-10-29  9:56                           ` Ard Biesheuvel
2020-11-03  7:24                             ` Ard Biesheuvel
2020-11-03  8:43                               ` Dmitry Osipenko
2020-11-09  7:25                                 ` Ard Biesheuvel
2020-11-10  7:44                                   ` Dmitry Osipenko
2020-11-10  7:45                                     ` Ard Biesheuvel
2020-10-22 16:34                   ` Dmitry Osipenko
2020-10-22 17:38                     ` Russell King - ARM Linux admin
2020-10-22 17:47                       ` Ard Biesheuvel
2020-10-22 17:50                         ` Russell King - ARM Linux admin
2020-10-22 17:51                           ` Ard Biesheuvel
2020-10-22 19:05                       ` Dmitry Osipenko
2020-10-22 14:57 ` Russell King - ARM Linux admin
2020-10-22 15:56   ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).