Re: [PATCH 1/1] arch/powerpc: Rework local_paca to avoid LTO warnings
From: Alastair D'Silva
Date: Wed Mar 13 2019 - 23:09:34 EST
On Thu, 2019-03-14 at 10:54 +1100, Daniel Axtens wrote:
> "Alastair D'Silva" <alastair@xxxxxxxxxxx> writes:
>
> > From: Alastair D'Silva <alastair@xxxxxxxxxxx>
> >
> > 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