Thread (4 messages) 4 messages, 3 authors, 2020-06-26

Re: [PATCH] powerpc/64: indirect function call use bctrl rather than blrl in ret_from_kernel_thread

From: Christophe Leroy <hidden>
Date: 2020-06-11 12:29:26


Le 11/06/2020 à 14:11, Nicholas Piggin a écrit :
blrl is not recommended to use as an indirect function call, as it may
corrupt the link stack predictor.

This is not a performance critical path but this should be fixed for
consistency.
There's exactly the same in entry_32.S
Should it be changed there too ... for consistency :) ?

ppc32 also uses blrl for calling syscall handler, should it be changed 
as well ?

Christophe
quoted hunk ↗ jump to hunk
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
  arch/powerpc/kernel/entry_64.S | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 223c4f008e63..f59a17471d4d 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -400,12 +400,12 @@ _GLOBAL(ret_from_fork)
  _GLOBAL(ret_from_kernel_thread)
  	bl	schedule_tail
  	REST_NVGPRS(r1)
-	mtlr	r14
+	mtctr	r14
  	mr	r3,r15
  #ifdef PPC64_ELF_ABI_v2
  	mr	r12,r14
  #endif
-	blrl
+	bctrl
  	li	r3,0
  	b	.Lsyscall_exit
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help