lkml.org 
[lkml]   [2019]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] arch/powerpc: Rework local_paca to avoid LTO warnings
From
Date
On Thu, 2019-03-14 at 10:54 +1100, Daniel Axtens wrote:
> "Alastair D'Silva" <alastair@au1.ibm.com> writes:
>
> > From: Alastair D'Silva <alastair@d-silva.org>
> >
> > When building an LTO kernel, the existing code generates warnings:
> > ./arch/powerpc/include/asm/paca.h:37:30: warning: register of
> > ‘local_paca’ used for multiple global register variables
> > register struct paca_struct *local_paca asm("r13");
> > ^
> > ./arch/powerpc/include/asm/paca.h:37:30: note: conflicts with
> > ‘local_paca’
> >
> > This patch reworks local_paca into an inline getter & setter
> > function,
> > which addresses the warning.
> >
> > Generated ASM from this patch is broadly similar (addresses have
> > changed and the compiler uses different GPRs in some places).
>
> Ditto to Christophe's comment; I'd love to know how to build this so
> I
> can actually see the differences. Perhaps you could bundle up all the
> required changes and send it as a patch series with a cover letter
> explaining this?

The differences are visible in a normal build, but if you want to play
with LTO, see my comments to Christophe.

>
> > +static inline struct paca_struct *get_paca_no_preempt_check(void)
> > +{
> > + register struct paca_struct *paca asm("r13");
> > + return paca;
> > +}
>
> Isn't the convention to have the { on the same line as the function,
> or
> am I horrible mis-remembering things?
>
You are :)

> Should these functions be __always_inline?
>

Yes, they should, I'll add that to V3.

--
Alastair D'Silva
Open Source Developer
Linux Technology Centre, IBM Australia
mob: 0423 762 819

\
 
 \ /
  Last update: 2019-03-14 04:10    [W:0.089 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site