LKML Archive on
help / color / mirror / Atom feed
From: Christophe Leroy <>
To: Benjamin Herrenschmidt <>,
	Paul Mackerras <>,
	Michael Ellerman <>
Subject: [PATCH] powerpc/32: indirect function call use bctrl rather than blrl in ret_from_kernel_thread
Date: Fri, 20 Aug 2021 05:16:05 +0000 (UTC)	[thread overview]
Message-ID: <> (raw)

Copied from commit 89bbe4c798bc ("powerpc/64: indirect function call
use bctrl rather than blrl in ret_from_kernel_thread")

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

Signed-off-by: Christophe Leroy <>
 arch/powerpc/kernel/entry_32.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 0273a1349006..61fdd53cdd9a 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -161,10 +161,10 @@ ret_from_fork:
 	bl	schedule_tail
-	mtlr	r14
+	mtctr	r14
 	mr	r3,r15
-	blrl
+	bctrl
 	li	r3,0
 	b	ret_from_syscall

             reply	other threads:[~2021-08-20  5:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  5:16 Christophe Leroy [this message]
2021-08-20 12:15 ` Michael Ellerman
2021-08-20 17:18   ` Segher Boessenkool
2021-08-20 18:12     ` Segher Boessenkool
2021-08-27 13:15 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] powerpc/32: indirect function call use bctrl rather than blrl in ret_from_kernel_thread' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).