public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jason Baron <jbaron@akamai.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH v2] powerpc/32: Add support for out-of-line static calls
Date: Fri, 11 Mar 2022 15:56:57 +0100	[thread overview]
Message-ID: <c0b8cb0e-cd96-d660-db87-51ded45435c2@csgroup.eu> (raw)
In-Reply-To: <YS419Exj6PpESVc/@hirez.programming.kicks-ass.net>

Hi Peter,

Le 31/08/2021 à 16:00, Peter Zijlstra a écrit :
> On Tue, Aug 31, 2021 at 01:12:26PM +0000, Christophe Leroy wrote:
> 
> Yes, this should work nicely!
> 
> Since you have the two nop's at the end, you could frob in an
> optimization for __static_call_return0 without too much issue.
> 
> Replace the two nops with (excuse my ppc asm):
> 
> 	li r3, 0
> 	blr
> 
> and augment arch_static_call_transform() with something like:
> 
> 	if (func == &__static_call_return0)
> 		err = patch_branch(tramp, tramp+24, 0);

I just discovered that we likely have an issue with the implementation 
of that RET0 static call.

Looking at System.map I have:

	c0004fc0 t __static_call_return0
	c0011518 t __static_call_return0
	c00d8160 t __static_call_return0


So when we do:

	if (func == &__static_call_return0)

It is unlikely that we'll get the expected one.


I see __static_call_return0 is defined as 'static inline' in 
include/linux/static_call.h

Any reason for not having it as a single global symbol instead ?

Thanks
Christophe

      reply	other threads:[~2022-03-11 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 13:12 [PATCH v2] powerpc/32: Add support for out-of-line static calls Christophe Leroy
2021-08-31 14:00 ` Peter Zijlstra
2022-03-11 14:56   ` Christophe Leroy [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=c0b8cb0e-cd96-d660-db87-51ded45435c2@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=ardb@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox